Closed (fixed)
Project:
Smarty Admin
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2023 at 05:22 UTC
Updated:
7 Feb 2025 at 11:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
shreya_th commentedComment #3
shreya_th commentedComment #4
anish.ir commentedComment #5
anish.ir commentedHi,
I encountered an issue where the hamburger menu in the theme was not working correctly. After debugging, I discovered that the JavaScript files required for the functionality were not being loaded due to incorrect paths. Specifically, the plugin_path variable in the test.js file was pointing to the custom folder instead of the contrib folder. So, whenever we install the site it is installed in the '/themes/contrib/' rather than '/themes/custom/'.
Here’s a summary of the issue and resolution:
Issue:
Resolution:
var plugin_path = '/themes/contrib/smarty_admin/assets/plugins/'Recommendation:
Please update the test.js file in the theme to ensure the correct path (contrib instead of custom) is used for plugin_path.
Alternatively, consider making the path dynamic to avoid hard-coding issues in the future.
Currently, I am raising the MR with the changes and attaching the screenshots along with the error Let me know if you need any further details or assistance.
Thanks!
Comment #7
anish.ir commentedComment #8
anish.ir commentedHi,
As mentioned earlier, the issue with the hamburger menu not working was due to incorrect paths in the plugin_path variable in test.js, which pointed to
/themes/custom/instead of/themes/contrib/.I resolved this by dynamically setting the theme path in drupalSettings using the following approach:
Updated test.js to:
var plugin_path = drupalSettings.smartyAdmin.themePath + '/assets/plugins/';This ensures the correct path is used dynamically, avoiding hardcoding issues. Now, whatever the path of the theme be, the scripts will load dynamically.
I've raised an MR with the changes.
Thanks!
Comment #9
hetal.solanki@anish.ir
I have review MR!5. It's working for me.
Moving to RTBC.
Thank you!!
Comment #11
jaydeep_patel commentedMerged.
Comment #12
jaydeep_patel commentedThank you @shweta__sharma, @anish.ir and @hetal.solanki for your contribution.