ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Database 1054 error - 62 custom channel fields

January 18, 2011 11:07am

Subscribe [2]
  • #1 / Jan 18, 2011 11:07am

    rgres

    4 posts

    Hi -

    Running v2.1.3 Build:  20101220

    This is not an issue involving an upgrade from a previous version.

    Here’s what happened:

    Created a custom channel fieldgroup and then created 8 Relationship-type fields all populating from the same channel. Created a new channel and assigned the new channel fieldgroup to it. Then went ahead and created a new channel entry in the new channel. I was testing to see that content was correctly displaying in one of my templates, along with conditional code that would display alternative content for empty fields. Everything worked fine.

    Then, I went back to the custom channel fieldgroup and added a bunch more fields (total of 62 custom fields in all), combination of relationship-type (all pulling from the same channel) and text input type. When I went back to edit the channel entry in order to populate the newly-created fields I got this error when I clicked on the channel entry title on the Content > Edit page:

    <<<<<<<<<<<<<<<<<

    A Database Error Occurred

    Error Number: 1054

    Unknown column ‘0’ in ‘order clause’

    SELECT entry_id, title FROM (exp_channel_titles) WHERE `channel_id` = ‘0’ ORDER BY 0 ASC

    Filename: fieldtypes/ft.rel.php

    Line Number: 88

    >>>>>>>>>>>>>>>>>

    I then tried to publish a new entry for that channel and got the same error.

    I then deleted the original entry and tried publishing a new entry again and got the same error.

    I then went ahead and deleted the channel, then created a new channel, assigned the channel custom field group to that channel, and tried publishing again. Same error.

    I went back to the Edit Group Assignments page for that newly created channel and selected an older field group (which had far less than 62 custom fields), and then tried publishing. Did not get the error and saw the regular publish entry form.

    Just wondering if this is a known issue involving a large number of custom fields? (The other 1054 error posts I checked almost all involved upgrading from a previous version, add-on compatibility, etc.)

    Thanks for your time -

    Ric

  • #2 / Jan 18, 2011 12:12pm

    rgres

    4 posts

    More info:

    I went ahead and thought I could make progress by deleting some of the custom channel fields from the field group with 62 custom fields. Here is what I am encountering:

    When I try to delete any of the relationship-type fields from the field group I get the following php error (and the field remains on the Add/Edit Custom Fields page for that field group):

    <<<<<<<<<<<<<<<<<<<<<<<<

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined property: Rel_ft::$db

    Filename: fieldtypes/ft.rel.php

    Line Number: 202

    Fatal error: Call to a member function select() on a non-object in /var/www/pbshawaii/pbsadmin/expressionengine/fieldtypes/ft.rel.php on line 202

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    I am able to delete text input and file-type fields normally.

    Ric

  • #3 / Jan 19, 2011 12:57am

    John Henry Donovan

    12339 posts

    Ric,

    The deletion of a relationship field is a known bug and is fixed for next release

    Are you saving a Publish Layout?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases