After defining a new post type, i get this error on every admin page. deleting/reinstalling the plugin does not resolve the problem.
Fatal error: Call to a member function add_cap() on a non-object in ..\wp-content\plugins\more-types\more-types-object.php on line 121
Thanks
gervasioantonio
Member
Posted 2 years ago #
I'm having this issue too.
In fact this error only shows up if up change something in the 'Advanced Settings' page while creating/editng a new type, specifically if you assign some capabilities to the listed roles.
henrikmelin
Member
Plugin Author
Posted 2 years ago #
Thanks for the bug report - I'll be fixing this in the next version. We're in the process of ironing stuff like this out, preparing for 1.0 which'll be out this week!
gervasioantonio
Member
Posted 2 years ago #
Thanks for the fast response. I'll wait patiently :)
BTW, big thanks for the awesome "More..." suite!
cvernon
Member
Posted 2 years ago #
Hello,
Still having this error:
Fatal error: Call to a member function add_cap() on a non-object in /%SERVERPATH%/wp-content/plugins/more-types/more-types-object.php on line 135
Is this the same error? I just downloaded this and set it up yesterday. It works fine until I log out of admin, at which point all is broken...
Please let me know asap if you are going to be able to fix this soon, or if the community can help resolve this for us all,
Thanks,
Hey,
I just comment out the line and it seems to work. What kind of capability do this line add (to what?!)?
Posts with this "more type" Type are not displayed in the frontend. Also with that error line enabled.
TheB
Hello
If roles aren't important for you, you just have to comment line 135 in more-types-object.php file ;)
Taylor Baybutt
Member
Posted 2 years ago #
my apologies, commenting out works!
Roles are important to me but I am willing to sacrifice them in this instance to get the plugin working. However, commenting it out is not working, did you try logging out and logging back in? It only seems to happen on the login screen.
even when I delete the whole line, the error still shows up and says its on that line. so strange.
rnconfalonieri
Member
Posted 2 years ago #
Hello:
I'm working with WordPress 3.1 and the more-tipes plugin throws the following error:
Fatal error: Call to a member function add_cap() on a non-object in /%SERVERPATH%/wp-content/plugins/more-types/more-types-object.php on line 135
I need the complete functionality of the plugin, so I would like how to fix it or if it will be fixed in a short period of time.
Thank you very much.
Taylor Baybutt
Member
Posted 2 years ago #
You'll have better luck asking on the More Plugins support forums: http://labs.dagensskiva.com/forum/
This function would only be useful if you were setting roles i think.
Upstreet Media
Member
Posted 2 years ago #
Find line 135.
Chang: $wp_roles->add_cap($role, $capability);
To:
if(is_object($mp_roles) && method_exists($wp_roles,'add_cap'))
{
$wp_roles->add_cap($role, $capability);
}
Andrew Martin
Member
Posted 2 years ago #
@phxvyper Thanks so much, that fixed my issue. It was strange, it was only breaking in IE. Glad it's fixed now!
pete-sch
Member
Posted 2 years ago #
Bug is still present in the latest version.
Plugin version 2.0.3
WordPress version 3.0.1
Reproduction: Install and activate the plugin, set up some types and LOG OUT.
$wp_roles global variable is available only for the logged-on user.
parisvega
Member
Posted 2 years ago #
I'm having this same problem
parisvega
Member
Posted 2 years ago #
Find line 135.
Chang: $wp_roles->add_cap($role, $capability);
To:
if(is_object($mp_roles) && method_exists($wp_roles,'add_cap'))
{
$wp_roles->add_cap($role, $capability);
}
That totally worked. Thanks phxvyper!
Change to line 135 in more-types-object.php worked for me, too. Thanks for the fix to the only problem I had moving to 3.1.
Donald Gilbert
Member
Posted 2 years ago #
This is still an issue in the latest release of the plugin - please test before you release. - just add this into the core on line 135 of more-types-objects.php - if(is_object($wp_roles))
shrinidhi
Member
Posted 2 years ago #
atlast worked...thanks for the help phxvyper..from: HackHow :P!!!
maximlubyanov
Member
Posted 2 years ago #
Please add the line to the more-types-object.php at line 182
elseif ($page['rewrite_bool']) $options['rewrite'] = array('slug' => $name);
Because now there is an error with rewrite.
ptroxler
Member
Posted 2 years ago #
Wow, this issue is still not resolved despite the "programmers" of this plugin promising otherwise MONTHS ago ...
would stronlgly advise against using the more suite, they're just not up to speed
I have problems too. I get a Internal server error when I have these plugins installed.At the moment I only have 2 plugins. The more fields and the more types plugin. After some testing I found out that it starts working again after this:
1. Rename the plugins folder
2. Reload the page (now the white screen of death is gone)
3. log in to wp-admin
4. Rename the plugins folder back to plugins
5. Activate the plugins from the wp-admin
6. It works again.
BUT...
ONLY in the browser that you logged in to.
Bug is still present in the latest version.
Plugin version 2.0.3
WordPress version 3.0.1
Reproduction: Install and activate the plugin, set up some types and LOG OUT.
$wp_roles global variable is available only for the logged-on user.
Yes I noticed. how do I resolve this global to be cut the head off?
sigh, good plugin but too bad the developers are not as good :(
not working at all, messing up encodings on site and so on
Looks like the latest version included the fix from phxvyper above.
Unfortunately, that fix had a typo in it. It says $mp_roles instead of $wp_roles for the is_object call.
And besides, why would you want to check that each time through the inner loop? Put the check outside the loops, as far up as possible.