Hello, everyone. I have a problem after upgrading to EE3 when I try to enter a new field (in any field group –new or otherwise). I get:
Fatal error: Call to a member function accepts_content_type() on a non-object in (removed)/system/ee/EllisLab/Addons/grid/libraries/Grid_lib.php on line 653
Line 653 (and 654) in Grid_lib is the following:
if ( ! $fieldtype->accepts_content_type('grid') ||
($this->content_type != 'channel' && $field_short_name == 'relationship'))
Now, I have “fixed” it by simply commenting the code:
// if ( ! $fieldtype->accepts_content_type('grid') ||
// ($this->content_type != 'channel' && $field_short_name == 'relationship'))
…and it does allow me to add new fields, BUT, who know what other sort of problems I am going to have down the road.
Here is the description up above the code as to what the code does:
// Check to see if the fieldtype accepts Grid as a content type;
// also, temporarily exlcude Relationships for content types
// other than channel
I would definitely appreciate some help here! My knowledge of php isn’t great, but I can definitely see that there is a problem accepting grid as a content type.
-John
Hi John,
I’ve seen this once before and the site had a fieldtype add-on in the system/user/addons
folder that was not version 3 compatible. If you have any, try moving them to a temporary location and see if that resolves the issue. If so, let me know and I’ll work on a getting a patch for the code.
Hey, Seth!
I appreciate the help -it worked! I restored the bad code and then moved the “grid” folder completely out of system/ee/EllisLab/Addons, and I am able to create new fields. I’ve tested this both on my local WAMP and the actual site, so it definitely works.
I would love it if we could get a fix for this, so any sort of patch would be much appreciated!
Thanks again, John
Ok, I see what you are saying -sorry about that. This is easy, though: I actually have ZERO user addons on the online site –only the index file (with only “Directory access is forbidden.”) is in that directory.
I have four user addons in the WAMP site (Tag, SEO Lite, Pillster, and Add-on Menu), but I think I can eliminate them as the problem since it’s happening both on WAMP and online.
I’m using EE 3.2.0.
Hi John,
Can I have you do two things for me? May I have a copy of your exp_fieldtypes
table? A screenshot will do. Additionally in system/ee/EllisLab/Addons/grid/libraries/Grid_lib.php
at line 650 can you add the following code:
if ( ! $fieldtype)
{
var_dump($field_short_name);
}
Once you’ve done that try to add a new field. You should see some debug code at the top of the page; if you could copy and paste that to me that’ll greatly help me diagnose the bug.
Ok, Seth…
I’ve attached the screenshot of the exp_fieldtypes, I’ve made the changes to Grid_lib.php, and I now get this:
string(3) “rte”
Fatal error: Call to a member function accepts_content_type() on a non-object in (removed)/ee/EllisLab/Addons/grid/libraries/Grid_lib.php on line 657
Fantastic –it worked!!! Thanks for your help!
By the way, I won’t go into detail much here because they need their own thread if they are indeed a problem (and not something I’ve done), but there are two quick possible quirks that I’ll just alert you to in advance (in case you want some casual reading):
1) The “Show Smileys” checkbox won’t stay checked when I’m creating a new field. They may very well be enabled (I haven’t gotten to the point where I’m going to the publish tab just yet), but the box is no longer checked when I go back to edit that field. I may try to uninstall/reinstall the emoticon add-on just like the RTE (…and it won’t update to emoticon 2.0 either -when I click the update button, nothing happens).
2) With the forum module, I think it possibly could be looking for user templates in the wrong spot. In “Upgrading from ExpressionEngine 2”, the instructions say “4.If you have the forum module installed, copy the directory themes/forum_themes/ to themes/user/forum_themes/”. Well, I couldn’t get my personal forum template to appear in the drop down selection until I actually moved it to themes/ee/forum themes. Once I did that, it showed my template.
This could be an path error on my part, but I haven’t found where I made that error yet! It will be a good week or two until I’m really playing with the forum part again, but I spent a little time on it before and couldn’t find anything immediately jumping out at me.
Thanks again for your help!
1) The “Show Smileys” checkbox won’t stay checked when I’m creating a new field. They may very well be enabled (I haven’t gotten to the point where I’m going to the publish tab just yet), but the box is no longer checked when I go back to edit that field. I may try to uninstall/reinstall the emoticon add-on just like the RTE (…and it won’t update to emoticon 2.0 either -when I click the update button, nothing happens).
I’ll take a look. This may be a bug.
2) With the forum module, I think it possibly could be looking for user templates in the wrong spot. In “Upgrading from ExpressionEngine 2”, the instructions say “4.If you have the forum module installed, copy the directory themes/forum_themes/ to themes/user/forum_themes/”. Well, I couldn’t get my personal forum template to appear in the drop down selection until I actually moved it to themes/ee/forum themes. Once I did that, it showed my template.
Oh dear, the paths are wrong in the docs. It should be themes/user/forum
. I’ll see about getting that adjusted.
Reinstalling the emoticons did allow me to get version 2, but it still shows as unchecked after I save a field and re-enter the field edit page. I did not see the emoticons on the field in “Publish”, either. It could be a path error (don’t know if this is possible, but maybe the box won’t stay checked if the emoticon directory url is wrong?), and I’ll eventually go through everything again and make sure –but I thought I had it right. So, thankfully, the lack of emoticons will not cause me to be dead in the water, ha ha,–but yes, please look into it if you can!
Thanks again for all the help!
Ah -sorry to waste your time with that one. I see that it DOES stay checked now. For some reason, I had a field that was “messed up”, wasn’t giving me all the field type choices, etc. When I saved it as another type and then reselected “text area”, it now stays checked!
Thanks again for your help!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.