Forum

Thread tagged as: Problem, Runway

Perch 3 Upgrade and Truncated Collections Item

Hi, I just noticed after upgrading to Perch 3 (Runway) that one of my Collection items (coincidentally the very first item I added to this particular Collection) is truncated in the control panel.

I.e., it just stops after a certain field about midway down. There's no Save/Cancel button available. Looking at Source shows the same thing: the HTML just stops at a certain point. I have debug on, but there's no debug output either.

Other items in the same Collection are okay. The HTML output of this item displays fine: it is not truncated.

I'm not certain this is related to Perch 3. It's a long form and I haven't visited this particular item for a while, so it's possible it was munged before I upgraded yesterday.

I'm guessing I will need to delete the whole item and re-enter it, but like I say it's a long form. Is there an easier/smarter fix?

Joel Davies

Joel Davies 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is there an error on the page or in your error log?

Yeah, checking my php_error.log I've got a whole bunch of these at the bottom:

[30-Mar-2017 10:09:55 America/Chicago] PHP Fatal error:  Uncaught Error: Call to a member function icon_for_type() on boolean in /Sites/trc-perch/sherp/core/lib/PerchFieldTypes.class.php:1843
Stack trace:
#0 /Sites/trc-perch/sherp/core/apps/content/PerchContent_Util.class.php(583): PerchFieldType_file->render_inputs(Array)
#1 /Sites/trc-perch/sherp/core/runway/apps/content/modes/collection.edit.form.post.php(160): PerchContent_Util::display_item_fields(Array, '57', Array, false, Object(PerchForm), Object(PerchTemplate))
#2 /Sites/trc-perch/sherp/core/runway/apps/content/modes/collection.post.php(2): include('/Sites/trc-perc...')
#3 /Sites/trc-perch/sherp/core/apps/content/collections/edit/index.php(31): include('/Sites/trc-perc...')
#4 {main}
  thrown in /Sites/trc-perch/sherp/core/lib/PerchFieldTypes.class.php on line 1843

...repeated multiple times, maybe as many times as I tried refreshing or switching back and forth to other Collection items.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do more appear as you load the page?

Yeah, it adds a new one, identical except for the timestamp, every time I revisit that Collections item in the Control Panel.

If it helps, the very next item at the point the truncation starts is a type="file" item intended for PDF upload. Maybe something to do with the icon_for_type ? I'm not great at parsing error logs!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, something to do with icon_for_type. What type of file do you have in that field?

It's a PDF.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Huh. Ok, we'll take a look and see what added tests we can put in place to deal with that.

As I said, this was the first item in this Collection. During the build I modified the template and resubmitted this one item many times to get the form fields ordered and displaying the way I wanted them. I wonder if the heavy hacking I did on this particular item has something to do with the issue, since none of the other items in the same Collection are affected.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I think all I can do is add more tests for edge cases.

Thanks, Drew, for checking into this. I'm going to just delete this item and reenter it, and hope that if there's some kind of corruption in the db that will clear it out.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, sounds like a pragmatic solution.

Drew McLellan

Drew McLellan 2638 points
Perch Support

We've added those extra checks for missing assets into 3.0.1.

Super!