-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix(Impact): use genericobject/front/getimpacticon.php to serve icon #368
fix(Impact): use genericobject/front/getimpacticon.php to serve icon #368
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
files
directory is not supposed to be exposed. It may be the time to fix it.
ead8f3b
to
98da35c
Compare
the first solution may not work if GLPI's "fiels" folder is in a different location ( using But does not allow to specify a subfolder We have to wait for this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll have to set minimal GLPI version to 10.0.12 if glpi-project/glpi#16241 is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't add an icon to my custom objects:
[2023-12-26 10:20:04] glpiphplog.WARNING: *** PHP Warning (2): rename(/home/teclib/localhost/glpi/10.0-bugfixes/files/_tmp/60d67067881900.71152486B.png,front/pluginimage.send.php?plugin=genericobject&folder=impact_icons&name=PluginGenericobjectVoiture_60d67067881900.71152486B.png): No such file or directory in /home/teclib/localhost/glpi/10.0-bugfixes/plugins/genericobject/inc/type.class.php at line 289
Backtrace :
plugins/genericobject/inc/type.class.php:289 rename()
plugins/genericobject/inc/type.class.php:218 PluginGenericobjectType->handleImpactIconUpdate()
src/CommonDBTM.php:1612 PluginGenericobjectType->prepareInputForUpdate()
plugins/genericobject/front/type.form.php:51 CommonDBTM->update()
Also could you confirm the specific case where the original issue happens ? Icons work fine on my side so I suppose its only with a specific config ? |
It doesn't matter whether the image is displayed in the impact analysis or in the object configuration. The plugin will always use Only the call from the impact analysis does not have to contain the full path to prevent double backslash ) |
Icon from genericobject is badly display from GLPI impact analysis
See relative path containing a double backslash
Clean relative icon path by removing extra backslash
as is already added by glpi core
https://github.com/glpi-project/glpi/blob/5d510f7cb9cd775a9477f98059a8e7569e2f904c/src/Impact.php#L1029