You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a file is selected in the file browser, its usage information is displayed under the Used on tab. However, if another file is subsequently selected, the Used on tab does not update to reflect the new file's usage information.
To view the correct usage information for the newly selected file, currently you have to click on the Details tab and then reselect the Used on tab.
How to reproduce
Navigate to the file browser and select any file (can be any file type) that is currently being utilised on a page
Click on the Used on tab to view the page(s) where the selected file is in use
Without deselecting the Used on tab, choose another file that is also being used on a page
Notice that despite the new file being in use, the message displayed is "This file is currently not in use." indicating that the Used on tab did not update correctly with the selection of the new file
Possible Solution
It looks like the usage method on the UsedOnTable class is not being fired when clicking on a subsequent file due to the Used on tab already being selected.
If you repeat the steps and get hit with the "This file is currently not in use." message, and then select the Details tab and then select the Used on tab again, the correct pages show.
So possibly need to make sure that the usage method is being properly fired when selecting a subsequent file
Additional Context
No response
Validations
Check that there isn't already an issue that reports the same bug
Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
The text was updated successfully, but these errors were encountered:
I have two notes here - that might be helpful. Not directly related, but give some additional info:
1
I noticed that in a large install, the "Used On" is often empty and then after a few loads (click on another image, click on the original image, etc...), it starts loading the data correctly. Is that because it is loaded through ajax async with React in the mix?
2
There is no canView check for any of the related objects AFAIK. This exposes the Existence, Title and Link of a DataObject to users where canView returns false for those. This could be added here: vendor/silverstripe/admin/code/Forms/UsedOnTable.php
Module version(s) affected
2.2.13
Description
When a file is selected in the file browser, its usage information is displayed under the Used on tab. However, if another file is subsequently selected, the Used on tab does not update to reflect the new file's usage information.
To view the correct usage information for the newly selected file, currently you have to click on the Details tab and then reselect the Used on tab.
How to reproduce
Possible Solution
It looks like the
usage
method on theUsedOnTable
class is not being fired when clicking on a subsequent file due to the Used on tab already being selected.If you repeat the steps and get hit with the "This file is currently not in use." message, and then select the Details tab and then select the Used on tab again, the correct pages show.
So possibly need to make sure that the
usage
method is being properly fired when selecting a subsequent fileAdditional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)The text was updated successfully, but these errors were encountered: