Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Error loading Modules when login as SuperAdmin

Error loading Modules when login as SuperAdmin

Hello

Time ago you give me a great help for include a recipe in metamod who allow to display module according to the fact if Author have or not a featured/non-featured Jreview listing. Here the code you provide me:

Code:

if ($user->id > 0) {

  $userid = (int)$user->id;
  $query = "select " .
    " ( select count(jrc.featured) from #__jreviews_content jrc, " .
    " #__content c where c.id = jrc.contentid and jrc.featured = 1 " .
    " and c.created_by = $userid) as feat, " .
    " ( select count(jrc.featured) from #__jreviews_content jrc, " .
    " #__content c where c.id = jrc.contentid and jrc.featured = 0 " .
    " and c.created_by = $userid) as nonfeat ";
  $db->setQuery($query);
  $result = $db->loadObject();
  if ($result == null) return; // short-circuit if there was an error

  // replace XXX with module id to return if author has a featured listing,
  // and YYY with module if to return if they have listings that are not featured:

  if ($result->feat > 0) return 85; // if they have featured articles
  if ($result->nonfeat > 0) return 119; // if they have non-featured articles
}

This code work well but I just discover today, when I login in front-end as SuperAdmin I get this message telling "Error loading Modules: " without any other informations. I suspected it was Metamod and I have disabled the module and now I don't get anymore the error.

It seem is needed to modify the code for ignore modules when a logged-in users is not Author...just like is for Registered group... Except this display error it seem I get no other bad side effect but is always stress to surf on your site with a red warning like that in every pages :-)

Any clue please??

many thank

Joomla 1.5.23
Metamod v2.6

dotcom22
Junior Modder
ranks
useravatar
Offline
21 Posts
Administrator has disabled public posting

Re: Error loading Modules when login as SuperAdmin

Hi dotcom22,

the message about "Error loading Modules" happens when you return a value in MetaMod, OR put a value in the "quick include module id" that is not a valid module id or module position.

Can I suggest that you turn on MetaMod debug mode and see which module id it's trying to include when you get this message?

I wonder if either there's a MetaMod active on your site that you have forgotten about, OR one of the module ids you are returning in the PHP above is invalid, OR there's some extra code that you didn't paste above, that checks whether the user is a superadmin.

Hope that helps you find it,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Error loading Modules when login as SuperAdmin

hello Stephen

You are perfectly right... For some unknown reason the module ID 119 was not correct..

It seem also I had deleted one module and of course Metamod was not able to find and display a missing module... It strange because I don't remember to have deleted this module (custom html) and I don't know why the ID number was 119 because actually the most higher ID number is 102...

Too bad Joomla don't have a Module Trash (like for menu and article) because This would have helped me to understand...anyway now the problem is solved..

Many thank for your rock and quick support :-)

All the best

cheers

dotcom22
Junior Modder
ranks
useravatar
Offline
21 Posts
Administrator has disabled public posting

Re: Error loading Modules when login as SuperAdmin

Hi. I have the same problem and it keeps coming back. I turned on the debug and I included the code to the php in the metamod module but somehow it keeps coming back the error. This is frustrating. Is there any fix for this? I really like how metamod works it just that it doesn't work correctly. Please help. I need this to work. Thanks.

jmarian1
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: Error loading Modules when login as SuperAdmin

Hi,

if you are getting an error saying "error including modules", then you're either doing a "return" statement that contains a module id that does not exist, OR you are including a module id that doesn't exist in the "Quick module id or position include" box.

When you turn on advanced debug mode and you get the error showing, what module id does the debug output say is being attempted? That should give you somewhere to start looking at the code in the PHP box to see where it's returning that id number.

It might also be useful to post the contents of the PHP box into the forum here, for someone to take a look at it.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10789
Newest User:
parus6
Members Online:
1
Guests Online:
231

Online: 
parus6

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked