Be sure to checkout our newest add-on, Speedy — Advanced Caching for ExpressionEngine.

Compatibility updates:

  • Publisher is EE5 compatible, but it does not currently support the Fluid field (it's in the works).

Ticket: Fatal Error when trying to create field

Status Resolved
Add-on / Version Bloqs 4.0.21
Severity
EE Version 5.2.4

Jarod Clark

Jul 02, 2019

Hello, we have a new EE 5 install with Bloqs on it. We have configured our various blocks and are now trying to create the field.

Going to the create field page yields this error:

Fatal error: Uncaught Error: Call to a member function accepts_content_type() on boolean in /path/to/site/system/ee/EllisLab/Addons/grid/libraries/Grid_lib.php:685
Stack trace:
#0 /path/to/site/system/ee/EllisLab/Addons/grid/libraries/Grid_lib.php(1005): Grid_lib->get_grid_fieldtypes()
#1 /path/to/site/system/ee/EllisLab/Addons/grid/libraries/Grid_lib.php(896): Grid_lib->getGridFieldtypeDropdownForColumn(NULL)
#2 /path/to/site/system/ee/EllisLab/Addons/grid/ft.grid.php(499): Grid_lib->get_column_view(Array, NULL)
#3 /path/to/site/system/ee/EllisLab/Addons/grid/ft.file_grid.php(61): Grid_ft->getSettingsVars()
#4 /path/to/site/system/ee/legacy/libraries/api/Api_channel_fields.php(410): file_grid_ft->display_settings(Array)
#5 /path/to/site/system/ee/EllisLab/ExpressionEngine/Model/Co in /path/to/site/system/ee/EllisLab/Addons/grid/libraries/Grid_lib.php on line 685

I added some debugging output and where it fails is on loading the bloqs fieldtype.

(Also, as a side note, v4.0.21 still has 4.0.20 as the version number in the code)

#1

BoldMinded (Brian)

Jul 02, 2019

Jarod, what have you done to debug the issue? I just tried this in a 5.2.3 and 5.2.4 environment and it saves a new Bloqs field just fine. Does it happen when any blocks are assigned? What happens if no blocks are assigned? Have you tried to replicate this in a clean EE environment with only Bloqs installed and no other add-ons or custom fieldtypes?

#2

Jarod Clark

Jul 02, 2019

Hey Brian,

We have not tried a new environment. On this install we had already gone through and created 10 different blocks. Had not created any fields yet until trying now.

As for debugging, had added some echo and var_dump tags to the core file to try and track down where it was breaking. Here is the output:

Text Input
object(Text_ft)#812 (10) {
  ["info"]=>
  array(2) {
    ["name"]=>
    string(10) "Text Input"
    ["version"]=>
    string(5) "1.0.0"
  }
  ["has_array_data"]=>
  bool(false)
  ["field_id"]=>
  NULL
  ["field_name"]=>
  NULL
  ["EE":protected]=>
  NULL
  ["settings"]=>
  array(0) {
  }
  ["id":protected]=>
  NULL
  ["name":protected]=>
  NULL
  ["content_id":protected]=>
  NULL
  ["content_type":protected]=>
  string(7) "channel"
}

...

File Grid
object(file_grid_ft)#783 (12) {
  ["info"]=>
  array(2) {
    ["name"]=>
    string(9) "File Grid"
    ["version"]=>
    string(5) "1.0.0"
  }
  ["settings_form_field_name"]=>
  string(9) "file_grid"
  ["has_array_data"]=>
  bool(true)
  ["errors":"Grid_ft":private]=>
  NULL
  ["field_id"]=>
  NULL
  ["field_name"]=>
  NULL
  ["EE":protected]=>
  NULL
  ["settings"]=>
  array(0) {
  }
  ["id":protected]=>
  NULL
  ["name":protected]=>
  NULL
  ["content_id":protected]=>
  NULL
  ["content_type":protected]=>
  string(7) "channel"
}
Duration
object(Duration_Ft)#781 (10) {
  ["info"]=>
  array(2) {
    ["name"]=>
    string(8) "Duration"
    ["version"]=>
    string(5) "1.0.0"
  }
  ["has_array_data"]=>
  bool(false)
  ["field_id"]=>
  NULL
  ["field_name"]=>
  NULL
  ["EE":protected]=>
  NULL
  ["settings"]=>
  array(0) {
  }
  ["id":protected]=>
  NULL
  ["name":protected]=>
  NULL
  ["content_id":protected]=>
  NULL
  ["content_type":protected]=>
  string(7) "channel"
}
Bloqs
bool(false)

This was in the /path/to/site/system/ee/EllisLab/Addons/grid/libraries/Grid_lib.php file.

The line that was setting it to a variable of false was this:

$fieldtype = $ft_api->setup_handler($field_short_name, TRUE);
#3

BoldMinded (Brian)

Jul 02, 2019

What other custom fieldtypes do you have installed? This doesn’t sound like a Bloqs bug, otherwise I would have had similar reports by now, and be able to replicate it myself. Its possible something is conflicting, which is why I’m curious what other fieldtypes are installed, and if you’ve tried it in a clean EE environment.

#4

Jarod Clark

Jul 02, 2019

Well, actually looks like something just didn’t install properly.

I just exported the definition tables for bloqs so I wouldn’t lose our configurations and then uninstalled and reinstalled the module.

It’s working fine now. So false alarm.

#5

BoldMinded (Brian)

Jul 02, 2019

I just tried it in a build running EE 6 too, still no errors. Something in your environment is likely causing the problem, or causing Bloqs to get confused.

#6

BoldMinded (Brian)

Jul 02, 2019

That is interesting. Was this a brand new install or an upgrade from a previous Bloqs build? If upgrade what was the version?

#7

Jarod Clark

Jul 02, 2019

It was a new download and clean install of EE.

I just checked with my team member that did the install originally, and it seems some of the files (specifically in vendor that I know of) didn’t upload originally when we set it up. That seems to have caused an incomplete install process, even though the files were reuploaded after the fact.

So, doesn’t really seem like an issue on your side at all. (although, as I mentioned, the version number on your site doesn’t match the code lol).

Thanks for looking into it.

#8

BoldMinded (Brian)

Jul 02, 2019

Ah, ok. Well, glad it is sorted out 😊

Thanks for pointing out the version number issue. I’ll get that fixed now.

Login to reply

Contact

For add-on support, please use the Support section. General inquries and pre-sale questions can be sent to support@boldminded.com.