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.

Publish fields markup is breaking

November 05, 2011 1:52pm

Subscribe [5]
  • #1 / Nov 05, 2011 1:52pm

    I have been able to duplicate this error 3 times now in EE v2.3.1.

    Here is how I am duplicating the error:

    1. Create your custom field set

    2. Create the channel with your custom fieldset and status

    3. Publish a new entry and start modifying all the publishing tabs and field layout. I deleted pretty much all the tabs and re-created them with new names. I made sure to include all the required fields and saved the layout. Refreshed, and everything is fine.

    4. Go back to the channel fields administration page and add some new fields.

    5. Go back to the publishing page to organize the newly created field and this is what I found.

    The only fix I have found is to delete the channel and recreate it, which deletes all my layout settings. This is a huge pain. I have tons of issues rearranging fields and tabs with every version, however this bug is the worst yet, as it breaks the page.

    Everything is fine until I add more fields after creating the channel. The site I am building now is rather large and quite complicated with close to 100 custom fields which makes it pretty hard to get every single field right without having to delete the channel and recreate the tedious layout every time. I realize I could grab the layout data from the db, which I likely will to avoid doing work over and over.

  • #2 / Nov 07, 2011 9:54am

    Kevin Smith

    4784 posts

    Hi SaucePan Creative,

    Sorry you’re experiencing this problem again. It looks like you’re using some custom fieldtypes in this channel, correct? What are those custom fieldtypes? Could you try to recreate this without any third-party fieldtypes?

    Also, could you take a screenshot of the Publish Page layout with the toolbar open (meaning you can edit the Publish Page) before any of the errors appear?

    I suspect it’s one of the third-party fieldtypes that’s causing the Publish Page to break in this case. Let me know if you find any additional information while you troubleshoot!

  • #3 / Nov 07, 2011 11:32am

    I just ran into this problem again. This time it occurred after I added a File field to a channel with almost 40 fields. I am building a rather complicated large site and there is no really good way to break these fields out of this channel, so it’s somewhat hard to work with.

    Give me some time to try to duplicate the error a little more without third party fields. The only third party fields I have installed are Wygwam and Matrix. I have two more fields that I wrote (Google Maps for ExpressionEngine and a new custom fieldtype built specifically for this project).

    The problem only occurs when I change the default publishing tabs, as in I delete them all and new ones with custom names. All the fieldtypes work 100% of the time if I leave the default publishing tabs. The only module I use that modifies the default tabs structure is the Pages module.

  • #4 / Nov 07, 2011 12:04pm

    This is a screenshot of the channel working before I make any layout modifications. It’s only after the point of modifying these tabs and adding more custom fields do things start to mess up. I even tried saving a serialize layout (from the db) and in place of the new layout, and it still broke. I deleted the layout and it works fine again. There is nothing within the Fieldtype API – at least to my knowledge – that would leave me to believe this has anything to do with my code or Pixel and Tonic’s code.

  • #5 / Nov 07, 2011 12:17pm

    Ok, now this is a screenshot of the error (again) after I added created a new custom tab and moved only a few of the fields into the new tab. The new fields I created were just regular input boxes. All other tabs remain in tact

    As a test, I just created a News channel and added once of each type of third party fields used in the other channel. I can’t duplicate the error at all with the news channel even will all the custom fieldtypes installed although I don’t have nearly as many fields as in the other channel.

    Thoughts?

  • #6 / Nov 07, 2011 12:41pm

    Sorry for all the sequential posts, but I am posting as I figure stuff out. This will be last post outlining my solution/workaround…

    I started some debugging on my own to see if I could figure out why this problem is occurring. The problem is on the views/content/publish.php file according to the error. So I went to that line and added the following code to debug the output.

    if(!isset($field['field_visibility']))
    {
    var_dump($field);exit();
    }

    Here is what I got

    array(38) {
      ["field_id"]=>
      string(2) "83"
      ["site_id"]=>
      string(1) "1"
      ["group_id"]=>
      string(1) "2"
      ["field_name"]=>
      string(11) "field_id_83"
      ["field_label"]=>
      string(27) "Special Guests Sponsor Name"
      ["field_instructions"]=>
      string(0) ""
      ["field_type"]=>
      string(4) "text"
      ["field_list_items"]=>
      string(0) ""
      ["field_pre_populate"]=>
      string(1) "0"
      ["field_pre_channel_id"]=>
      string(1) "0"
      ["field_pre_field_id"]=>
      string(1) "0"
      ["field_related_to"]=>
      string(7) "channel"
      ["field_related_id"]=>
      string(1) "3"
      ["field_related_orderby"]=>
      string(5) "title"
      ["field_related_sort"]=>
      string(4) "desc"
      ["field_related_max"]=>
      string(1) "0"
      ["field_ta_rows"]=>
      string(1) "6"
      ["field_maxl"]=>
      string(3) "128"
      ["field_required"]=>
      string(1) "n"
      ["field_text_direction"]=>
      string(3) "ltr"
      ["field_search"]=>
      string(1) "n"
      ["field_is_hidden"]=>
      string(1) "n"
      ["field_fmt"]=>
      string(4) "none"
      ["field_show_fmt"]=>
      string(1) "n"
      ["field_order"]=>
      string(2) "41"
      ["field_content_type"]=>
      string(3) "all"
      ["field_settings"]=>
      string(356) "YTo3OntzOjE4OiJmaWVsZF9jb250ZW50X3R5cGUiO3M6MzoiYWxsIjtzOjE4OiJmaWVsZF9zaG93X3NtaWxleXMiO3M6MToibiI7czoxOToiZmllbGRfc2hvd19nbG9zc2FyeSI7czoxOiJuIjtzOjIxOiJmaWVsZF9zaG93X3NwZWxsY2hlY2siO3M6MToibiI7czoyNjoiZmllbGRfc2hvd19mb3JtYXR0aW5nX2J0bnMiO3M6MToibiI7czoyNDoiZmllbGRfc2hvd19maWxlX3NlbGVjdG9yIjtzOjE6Im4iO3M6MjA6ImZpZWxkX3Nob3dfd3JpdGVtb2RlIjtzOjE6Im4iO30="
      ["field_dt"]=>
      string(0) ""
      ["field_data"]=>
      bool(false)
      ["dst_enabled"]=>
      bool(true)
      ["field_show_smileys"]=>
      string(1) "n"
      ["field_show_glossary"]=>
      string(1) "n"
      ["field_show_spellcheck"]=>
      string(1) "n"
      ["field_show_formatting_btns"]=>
      string(1) "n"
      ["field_show_file_selector"]=>
      string(1) "n"
      ["field_show_writemode"]=>
      string(1) "n"
      ["has_extras"]=>
      bool(false)
      ["field_fmt_options"]=>
      array(0) {
      }
    }

    And I was able to remedy the problem my changing the views/content/publish.php file to:

    https://gist.github.com/1345623

  • #7 / Nov 09, 2011 10:26am

    Dan Decker

    7338 posts

    Hi SaucePan Creative,

    No worries about the sequential posts, the more information you can provide, the better. Since you have gone through the trouble to ferret this out and devise a fix, could you possibly file a Bug Report and outline your solution there?

    Thanks!

  • #8 / Nov 09, 2011 3:55pm

    Certainly, I already filed a bug report when I initially report the problem. Is it possible to edit that one, or just create a new with the fix?

    On a side note, I have been testing the fix the last couple days and it actually works great, I haven’t encountered any more bugs. It creates a new Publish tab if one doesn’t exist so the page doesn’t break (like before). You can then drag that field to a new tab and delete the publish tab without issues (which I couldn’t do before).

  • #9 / Nov 11, 2011 11:15am

    Robin Sowell

    13255 posts

    Hrm- I really appreciate all of the debug you’ve done and the fix you’ve worked through.

    Found the bug report here and I can take care of updating the fix.

    That said?  The core problem is really that field visibility index not being set.  And it makes soooo not any sense to me how that happens.

    Given that it’s such a bear to reproduce (I haven’t), I’m wondering if the problem still exists without your patch and if so, whether it would be possible for me to go in and do a little testing.  (Don’t send any info- just checking since you do have a working fix.)  We really don’t want that index not being set, and looking at the code, I can’t spot why it’s happening.

  • #10 / Nov 17, 2011 10:08am

    Hey guys,

    Sorry for the delayed response, this project is huge and has to be ready by tomorrow and just haven’t had time to mess it since I seemed to have fixed the problem.

    I could try to setup a new channel using the same fields and try to duplicate error again but without messing up my current layout. I am glad to set you guys up an account so you get test appropriately and see what is causing the error. I am going to try to have it setup by this weekend.

    What kind of access do you need? Do you need FTP access, a CP login, or both?

  • #11 / Nov 17, 2011 10:37am

    Robin Sowell

    13255 posts

    Appreciate the offer, SaucePan Creative.  I’ve sent off an email with some details.  Don’t let me interfere if time is short!  But if you can easily get it displaying the bad behavior, I may be able to track down the source.  Heck- even if it’s being hidden by the check in the view file, if I know it’s missing from that array, I can likely track down the original ‘missing’.  Still unsure about HOW it got lost, but knowing where it’s lost from will help.

    < /babble>

  • #12 / Nov 22, 2011 1:06pm

    Ok, so I managed to make my deadline and got the site live. However, I am having trouble duplicating the error. I manage to duplicate the error once, but I wanted to make sure I could consistently duplicate it. After fixing the error and re-tracing my previous steps, I couldn’t duplicate the error again. So I moved on to a new project.

    Ironically, the error occurred again within the new project. The new project has a channel which contains almost 70 fields. It’s a channel that allows new patients to submit there confidential information online instead of mailing it. So, again the project requirements called for a very robust field set and of course required me to go continually edit the publishing layout and adding fields until I got it how I wanted it.

    So here is what I did this time…

    1. I created all fields within the Patients channel (all fields are either Text Inputs, Text Areas, or Select dropdowns – no third-party fields)

    2. I manipulated the publishing layout and deleted all the default tabs. I added all all required fields to the layout and saved. Everything was successful.

    3. I added a new custom field after realizing I forgot 1 of 70 the fields. Went back to the publishing screen and the same broken screen appeared.

    4. To fix it, this time I tried deleting the newly added custom field and refreshing the publishing page. This fixed the error.

    5. Now here is where things get weird. I added the same field, with the same name and everything back to the channel to see if I could reliable duplicate the error, but this time when I refreshed the publishing page it worked just fine! I really want to give you guys access to squash this bug, but if I can’t reliable duplicate it myself, I don’t expect you guys to be able to fix it either.

    I have a hunch as to how I can duplicate this error reliably. When I get get something setup and have it fail 100% of the time, I will give you guys access. I just wanted to update this thread to let you know the issue definitely still persists, but is incredible hard to reproduce unless I am not trying.

  • #13 / Nov 23, 2011 1:57pm

    Dan Decker

    7338 posts

    Hi SaucePan Creative,

    When you work out a solid method for duplicating, please let is know by starting a new thread or outlining it in the bug tracker. Thank you so much for your help and persistence on this.

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases