We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Fatal Error adding new fields after upgrade from EE2 to EE3 (problem seems to be EllisLab/Addons/grid)..

News and General

JohnChristianJr's avatar
JohnChristianJr
103 posts
9 years ago
JohnChristianJr's avatar JohnChristianJr

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

       
Seth Barber's avatar
Seth Barber
172 posts
9 years ago
Seth Barber's avatar Seth Barber

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.

       
JohnChristianJr's avatar
JohnChristianJr
103 posts
9 years ago
JohnChristianJr's avatar JohnChristianJr

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

       
Seth Barber's avatar
Seth Barber
172 posts
9 years ago
Seth Barber's avatar Seth Barber

Hi John,

That’s not what I had in mind, though it will make that problem go away. The problem stems from having an incompatible add-on in system/user/addons which the Grid library was attempting to access.

May I ask which version of ExpressionEngine you are running?

       
JohnChristianJr's avatar
JohnChristianJr
103 posts
9 years ago
JohnChristianJr's avatar JohnChristianJr

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.

       
JohnChristianJr's avatar
JohnChristianJr
103 posts
9 years ago
JohnChristianJr's avatar JohnChristianJr

I upgraded from EE 2.2.2 to 3.2.0, by the way –if that can make a difference here.

       
Seth Barber's avatar
Seth Barber
172 posts
9 years ago
Seth Barber's avatar Seth Barber

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.

       
JohnChristianJr's avatar
JohnChristianJr
103 posts
9 years ago
JohnChristianJr's avatar JohnChristianJr

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

       
Seth Barber's avatar
Seth Barber
172 posts
9 years ago
Seth Barber's avatar Seth Barber

Ah-ha! Thanks. You can remove that debug code. The problem is the RTE’s fieldtype wasn’t installed. Simply uninstall the RTE and re-install it and all will be well. I’ll also get a fix in for our next release.

       
JohnChristianJr's avatar
JohnChristianJr
103 posts
9 years ago
JohnChristianJr's avatar JohnChristianJr

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!

       
Seth Barber's avatar
Seth Barber
172 posts
9 years ago
Seth Barber's avatar Seth Barber
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.

       
JohnChristianJr's avatar
JohnChristianJr
103 posts
9 years ago
JohnChristianJr's avatar JohnChristianJr

That definitely fixed the forum issue! I’m assuming “wiki_themes” should be “wiki” as well (although I’m not going to have the wiki installed so I can’t check this).

       
JohnChristianJr's avatar
JohnChristianJr
103 posts
9 years ago
JohnChristianJr's avatar JohnChristianJr

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!

       
Seth Barber's avatar
Seth Barber
172 posts
9 years ago
Seth Barber's avatar Seth Barber

Hmm. I’m not reproducing the emoticon checkbox issue locally. Which field(s) are you trying it on, and by chance do you have any JS errors on the field edit page?

       
JohnChristianJr's avatar
JohnChristianJr
103 posts
9 years ago
JohnChristianJr's avatar JohnChristianJr

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!

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.