Support #13923
closedRequest to update Dante theme
Added by Javier Otero Pena almost 4 years ago. Updated almost 4 years ago.
0%
Description
Hello,
I have two sites on the CAC that use the Dante theme, but this theme has been broken for over a year. It used to have functionality such as team members, portfolios, etc. and all of this functionality is gone from the dashboard, making it impossible to update the websites properly.
Could you please update this theme and verify that it works as intended?
Thank you very much,
Best,
Javier Otero Peña
---
Related issues
Updated by Boone Gorges almost 4 years ago
- Status changed from New to Reporter Feedback
The Dante theme was last updated in October 2020, and I assume that we keep up with regular updates. Scott, can you confirm?
I believe that the Dante theme requires a secondary plugin, 'Dante Framework', for all of its functionality to be available. Perhaps the user has not activated the plugin? For reference, I downloaded the latest known version of the dante-framework plugin (at least, the version I could find that doesn't require a username and password) and it appears that it hasn't been updated since May 2020 - so I don't think our problem is an out-of-date companion plugin.
If the user is continuing to have problems, I can take a brief look. ("Brief" because this is a proprietary theme used by very few sites on the Commons, and I'm unable to provide extensive support to it.) I'll need the URL of the affected site.
Updated by Javier Otero Pena almost 4 years ago
Hi Boone,
I am not sure what the problem is, but it's been happening long before Oct 2020, which I guess means it cannot be the updates, it has to be something else. The Dante framework is installed, I think it installs automatically when using the Dante theme.
This happens on all websites using the Dante theme; I first found the problem on psrg.commons.gc.cuny.edu, but also found it when testing the theme on javo01.commons.gc.cuny.edu. One day the Dante additional functionality (eg Team Members, Portfolio) stopped working properly, and the buttons disappeared from the dashboard. Now we have a series of posts on the site that cannot be edited, as I get the error "Invalid post type" when I try to edit them (eg. https://psrg.commons.gc.cuny.edu/?team=javier-otero-pena).
I appreciate you taking a look and hopefully identifying and fixing the issue.
Thank you Boone!
Best,
Javier
---
Boone Gorges wrote:
The Dante theme was last updated in October 2020, and I assume that we keep up with regular updates. Scott, can you confirm?
I believe that the Dante theme requires a secondary plugin, 'Dante Framework', for all of its functionality to be available. Perhaps the user has not activated the plugin? For reference, I downloaded the latest known version of the dante-framework plugin (at least, the version I could find that doesn't require a username and password) and it appears that it hasn't been updated since May 2020 - so I don't think our problem is an out-of-date companion plugin.
If the user is continuing to have problems, I can take a brief look. ("Brief" because this is a proprietary theme used by very few sites on the Commons, and I'm unable to provide extensive support to it.) I'll need the URL of the affected site.
Updated by Boone Gorges almost 4 years ago
- Status changed from Reporter Feedback to Assigned
- Assignee set to Raymond Hoh
- Target version set to 1.18.4
Thanks for the follow-up, Javier. The additional details are helpful.
It looks like we on the Commons made some changes to dante-framework back in January 2020 in order to prevent problems where dante-framework was throwing fatal errors if the Dante theme was not active. See #12278. The problem with our changes is that they cause dante-framework never to load in any circumstances.
Ray, could you have a look? The technical details: you introduced a check for DANTE_TEMPLATE_PATH
in plugins/dante-framework/dante-framework.php. The Dante theme defines this file in its functions.php file. But a theme's functions.php is always loaded after plugins; see wp-settings.php.
For the time being, I've commented out the bail-condition on the production site, and it seems to have brought back the custom post types. Javier, can you confirm?
For next steps, I have two questions for Ray:
1. Do we need this check anymore at all? I know you improved the logic around theme deactivation in #12278. So maybe we don't need the failsafe at all.
2. If we still need it, is there a more reliable and load-order-independent check we can perform? Perhaps just checking 'dante' === get_template()
?
Updated by Javier Otero Pena almost 4 years ago
Hi Boone,
I confirm the custom post types are back, and the dashboard buttons to edit them are back too.
Thank you!!
Best,
Javier
---
Updated by Boone Gorges almost 4 years ago
Great, thanks! We'll keep this ticket updated with a more permanent fix.
Updated by Raymond Hoh almost 4 years ago
- Related to Bug #12278: Cannot acces dashboard due to "Critical Error" added
Updated by Raymond Hoh almost 4 years ago
- Related to Bug #11810: HTML presenting on front end added
Updated by Raymond Hoh almost 4 years ago
- Status changed from Assigned to Resolved
But a theme's functions.php is always loaded after plugins; see wp-settings.php.
Ugh, made a mistake here! I flip-flopped the order in my head during that commit.
1. Do we need this check anymore at all? I know you improved the logic around theme deactivation in #12278. So maybe we don't need the failsafe at all.
Yes, the check is still needed as explained in https://redmine.gc.cuny.edu/issues/12278#note-5.
When we're switching themes, we added some code to deactivate any plugins dependent on the theme.
However, during this time, those plugins are still loaded so any plugin that calls on the older theme's functions will cause a fatal error. This is the case with the dante-framework
plugin. Refreshing the page will fix the issue, but it's not pleasant to see a fatal error. That's why we still need the check.
2. If we still need it, is there a more reliable and load-order-independent check we can perform? Perhaps just checking 'dante' === get_template()?
This will work. I've added the fix here - https://github.com/cuny-academic-commons/cac/commit/5c98131022dd78796635754a1eaa88f141d68752.
And pushed this to production as a hotfix.