CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Incorrect links in admin menu, for some users
Pages: [1]

Author Topic: Incorrect links in admin menu, for some users  (Read 840 times)

krypto

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 5
  • IT guy for @bhahumanists. Running Civi on WP.
    • British Humanist Association
  • CiviCRM version: 4.5.8
  • CMS version: WordPress 4.x
  • MySQL version: 5.5.x
  • PHP version: 5.5.x
Incorrect links in admin menu, for some users
March 13, 2013, 05:13:01 am
I'm hunting down an issue where our admin menu links are generated incorrectly - but only for some users. We're on WordPress, and where the links should be:

http://humanism.org.uk/wp-admin/admin.php?page=CiviCRM&q=[whatever]

they lose the wp-admin and become:

http://humanism.org.uk/?page=CiviCRM&q=[whatever]

The weird part is, it doesn't apply globally: a random user will break at what seems like a random time. Everyone else carries on using the site no problem, while the users with the problem just see WordPress 'no permission' errors (which is a red herring, as permissions are fine - it's just the links that are broken).

I can fix instantly by rebuilding the menus, but it happens a couple of times a day.

So - when do the menus get regenerated, in normal Civi usage? Just so I can watch and try to work out when/why it's generating them incorrectly. I've checked the Resource URLs and they all seem fine - in the front-end, anyway.

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Incorrect links in admin menu, for some users
March 13, 2013, 08:03:34 am

The menu should not be displayed on the frontend of WP?

r u seeing the menu in the frontend?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

krypto

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 5
  • IT guy for @bhahumanists. Running Civi on WP.
    • British Humanist Association
  • CiviCRM version: 4.5.8
  • CMS version: WordPress 4.x
  • MySQL version: 5.5.x
  • PHP version: 5.5.x
Re: Incorrect links in admin menu, for some users
March 13, 2013, 08:10:15 am
No - this is just in the normal backend system.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Incorrect links in admin menu, for some users
March 13, 2013, 09:43:35 am

so menus only get generated / regenerated on startup / upgrades / explicit menu rebuild

r those users always on humanism.org.uk and not on www.humanism.org.uk?

also are we talking about specific urls? or the navigation menu at the top of each user's screen?

based on what u describe, seems like those menu items are regenerated when the user is accessing a non-admin page

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

krypto

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 5
  • IT guy for @bhahumanists. Running Civi on WP.
    • British Humanist Association
  • CiviCRM version: 4.5.8
  • CMS version: WordPress 4.x
  • MySQL version: 5.5.x
  • PHP version: 5.5.x
Re: Incorrect links in admin menu, for some users
March 13, 2013, 10:02:02 am
Sorry, terminology fail - when I said admin menu I meant the navigation menu at the top of each user's screen. The issue applies to every link in the navigation menu - no matter whether it's an admin one.

When you say startup, you mean when Civi is installed / the user is created? Sounds like it shouldn't be that often, though. Ok - I'll keep an eye on the db and see if I can determine how often it's happening.

The users should always be on humanism.org.uk (it should always redirect to this), but I'll dig into this one.

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Incorrect links in admin menu, for some users
March 13, 2013, 10:25:56 am

can you try this patch:

Code: [Select]
diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php
index d96e3fa..851fc4d 100644
--- a/CRM/Core/BAO/Navigation.php
+++ b/CRM/Core/BAO/Navigation.php
@@ -571,9 +571,11 @@ ORDER BY parent_id, weight";
   static function createNavigation($contactID) {
     $config = CRM_Core_Config::singleton();
 
-    // For Joomla front end user, there is no need to create
+    // For Joomla and WP front end user, there is no need to create
     // navigation menu items, CRM-5349
-    if ($config->userFramework == 'Joomla' && $config->userFrameworkFrontend) {
+    if (
+      ($config->userFramework == 'Joomla' || $config->userFramework == 'WordPress') &&
+      $config->userFrameworkFrontend) {
       return "<!-- $config->lcMessages -->";
     }

seems like those users first hit civi via WP frontend before switching to backend and this might be messing them up. this patch rectifies it and does the same for WP frontend as joomla

You should also do a menu rebuild to reset all current navigation entries

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Incorrect links in admin menu, for some users
March 13, 2013, 10:40:13 am

tracking this issue here:

http://issues.civicrm.org/jira/browse/CRM-12111
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

krypto

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 5
  • IT guy for @bhahumanists. Running Civi on WP.
    • British Humanist Association
  • CiviCRM version: 4.5.8
  • CMS version: WordPress 4.x
  • MySQL version: 5.5.x
  • PHP version: 5.5.x
Re: Incorrect links in admin menu, for some users
March 13, 2013, 11:51:04 am
Great - thank you! I've applied the patch - will see how it goes over the next few days.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Incorrect links in admin menu, for some users

This forum was archived on 2017-11-26.