Project

General

Profile

Actions

Support #13923

closed

Request to update Dante theme

Added by Javier Otero Pena about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
-
Target version:
Start date:
2021-02-01
Due date:
% Done:

0%

Estimated time:
Deployment actions:

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

Related to CUNY Academic Commons - Bug #12278: Cannot acces dashboard due to "Critical Error" ResolvedRaymond Hoh2020-01-09

Actions
Related to CUNY Academic Commons - Bug #11810: HTML presenting on front endResolvedBoone Gorges2019-08-29

Actions
Actions #1

Updated by Boone Gorges about 3 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.

Actions #2

Updated by Javier Otero Pena about 3 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.

Actions #3

Updated by Boone Gorges about 3 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()?

Actions #4

Updated by Javier Otero Pena about 3 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
---

Actions #5

Updated by Boone Gorges about 3 years ago

Great, thanks! We'll keep this ticket updated with a more permanent fix.

Actions #6

Updated by Raymond Hoh about 3 years ago

  • Related to Bug #12278: Cannot acces dashboard due to "Critical Error" added
Actions #7

Updated by Raymond Hoh about 3 years ago

  • Related to Bug #11810: HTML presenting on front end added
Actions #8

Updated by Raymond Hoh about 3 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.

Actions #9

Updated by Boone Gorges about 3 years ago

Thank you, Ray!

Actions

Also available in: Atom PDF