Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: tighter check for valid model #13349

Merged
merged 2 commits into from
Jul 21, 2023
Merged

Conversation

snipe
Copy link
Owner

@snipe snipe commented Jul 21, 2023

This should honestly never ever happen, since at a the model level we check for a valid model, BUT when it does happen (assuming the user manually edited something in the database, or restored from the before times when we didn't validate as strictly) that an asset has an invalid or null model_id, this should return a friendlier error message (versus a 500 error.)

This used to work this way, but when I added the model file tab and some of the manufacturer info, it assumed that relationship was a valid one, which broke the warning and would just then return a 500 error with a Trying to get property 'uploads' of non-object at /Users/snipe/Sites/snipe-it/snipe-it/storage/framework/views error.

@what-the-diff
Copy link

what-the-diff bot commented Jul 21, 2023

PR Summary

  • Update to Warning Message Text
    In message.php, the warning message 'no_association' was rewritten to provide a clearer explanation. It now states, 'WARNING! The asset model for this item is invalid or missing!'.

  • Enhancements to Warning Message Display
    In view.blade.php, changes were made on how the warning message is displayed. It is now prominently highlighted, likely leading to better user attention and awareness.

  • Change in Badge Display Line
    Adjustments were made to the line of code displaying the 'badge' in view.blade.php. It seems like a way to present certain counts, possibly enhancing performance or accuracy, but without further specifics, it's hard to explain the exact value here.

  • Changes to Hyperlink
    The line of code that generates a hyperlink for warranty information in view.blade.php was revised, potentially improving its functionality or user experience, but more details are needed to correctly identify the specific benefit.

  • Improved Conditions for Displaying Uploads
    Lastly, safeguards were bolstered in view.blade.php by improving the conditions which dictate when uploads should be displayed. This adds additional checks, reducing chances of errors when certain conditions (like the absence of an asset model or uploads) are met.

@snipe snipe merged commit 4fe6632 into develop Jul 21, 2023
@snipe snipe deleted the fixes/check_for_valid_model branch July 21, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant