Skip to content
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

CiviVolunteer Search for Opportunities page loads on front-end theme following update #494

Closed
kelizoliva opened this issue Jan 25, 2019 · 10 comments

Comments

@kelizoliva
Copy link

I had initially thought that issue #485 related to the issue I am experiencing, but it is not.

A client has CiviCRM 5.7.3 on Drupal 7, Angular Profiles 4.6-1.0.2, and CiviVolunteer 4.7.21-2.2.2. I updated them to the current releases: Angular Profiles 4.7.31-1.1.2 and CiviVolunteer 4.7.31-2.3.1. Now the "Manage Volunteer Projects" page loads front end theme rather than back-end theme.

I have aggressively cleared the caches, and have disabled and reenabled both extensions. None of this has had any effect. All other CiviCRM pages load the back-end theme, so this is isolated just to CiviVolunteer following these updates.

I don't have any explanation for why this is happening, the manage page should not be loading with the public theme, and up until the extension updates it was loading the back-end theme. This feels like a bug, but perhaps it is a configuration issue that I am just not recognizing?

@kelizoliva
Copy link
Author

More detail on this:

  • The main issue is that CiviVolunteer pages that are supposed to be loading with the admin theme, are instead loading with the front-end theme, as though they are public pages. This causes all kinds of mess in viewing. Somehow /civicrm/vol/#/volunteer/manage is being flagged as public-facing
  • Reviewed all permissions and all system settings that may relate to this issue, could not come up with anything that made a difference.
  • Verified that no custom civi extensions were conflicting with this extension
  • No errors or other alerts are coming up in the logs for CiviVolunteer pages.
  • The CiviCRM Theme module is in use, which specifies that the CiviCRM Admin pages load the 'Seven' theme, and CiviCRM Public pages load the custom site front-end theme. When changing which theme loads for CiviCRM public pages to the administrative theme, CiviVolunteer admin pages load correctly, but of course then all intentionally public-facing civicrm pages load with this theme rather than the custom site theme.
  • Attempted disabling the CiviCRM Theme module and installing the ThemeKey module to more granularly set what theme loads for civi in public/admin contexts. Set everything to load as admin, then set rules each of the civi components that should be public. CiviVolunteer pages could not be affected by this like everything else in the system. Instead, all CiviVolunteer pages continued to load with the admin theme, regardless of additional rules.
  • Removed ThemeKey module and re-installed CiviCRM Theme module with the original settings in place, returning CiviVolunteer pages to the original extension post-update issue.

@ginkgomzd
Copy link
Contributor

Hello,
Did you get to try rebuilding the CiviCRM Menu as I posted in Mattermost? The "menu" is really the routing system for Civi, so it could impact the logic that decides if it is a front-end or back-office page that is being rendered.

@kelizoliva
Copy link
Author

I have reviewed permissions (this was not the issue), and have aggressively cleared caches, civicrm/menu/rebuild?reset=1. None of these things has had an effect on the situation.

@kelizoliva
Copy link
Author

I do see now that I am getting this:

Declaration of CRM_Volunteer_Permission::check($permissions) should be compatible with CRM_Core_Permission::check($permissions, $contactId = NULL) Permission.php:151

Not sure what exactly it is referring to, or if it is directly effecting (or indicating) what I am seeing with this issue.

@kelizoliva
Copy link
Author

Also as a control, I disabled all modules except for CiviCRM (and CiviCRM Theme) and admin_menu. This had no effect, outcome is the same.

@karenannx
Copy link

This is the same error from this post I made: "CiviVolunteer error after upgrade to Civi 5.11.0 on joomla"
in stackexchange: https://civicrm.stackexchange.com/questions/30389/civivolunteer-error-after-upgrade-to-civi-5-11-0-on-joomla
Here is a response i got:
The warning you describe is fixed in the version of CiviVolunteer on github but they haven't tagged a release. The error sounds slightly different & turning on debugging might get more info.
However I logged an issue asking them to tag a release since there are unreleased civivolunteer fixes #508
You can get the latest civivolunteer code from github in the meantime - https://github.com/civicrm/org.civicrm.volunteer/archive/master.zip and see if that helps

@kelizoliva
Copy link
Author

We ended up figuring out that there's an XML file inside the Volunteer extension that tells Civi whether pages should be considered "public" (use the public theme) or not (use the admin theme). So we implemented another tiny extension to override the instructions that CiviVolunteer gives about public/private pages.

The error, however, is unrelated to the issue described in my original post; thank you @karenannx for the update about the code fix for that though! I will wait until the next release to apply the fix, as it does not seem to be causing any serious repercussions afaict.

@ginkgomzd
Copy link
Contributor

Hi @kelizoliva ,
I'm still curious about the problem you had. Would you be able to post your mini-extension (in a gist or pastebin)?

The "menu" config for manage volunteer opportunities looks to be configured properly for displaying in the back-office theme:
https://github.com/civicrm/org.civicrm.volunteer/blob/master/xml/Menu/Volunteer.xml#L14

Thanks, Cheers.

@kelizoliva
Copy link
Author

This extension simply designates the pages under /civicrm/vol as "private" so that the admin theme will be applied to them.

https://pastebin.com/3gFiZT5g

@ginkgomzd ginkgomzd changed the title Manage CiviVolunteer Opportunities page loads on front-end theme following update CiviVolunteer Search for Opportunities page loads on front-end theme following update May 13, 2019
@ginkgomzd
Copy link
Contributor

Thanks for sharing the code it helped me to understand finally what happened. I think I've been looking at too many instances that a) make the Manage form semi-public and b) don't use admin-themes.

I created issue #509 which I think is pretty non-trivial.

Thanks for reporting the issue.

nganivet added a commit to cividesk/org.civicrm.volunteer that referenced this issue Apr 15, 2021
yashodha added a commit to cividesk/org.civicrm.volunteer that referenced this issue Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants