Forum
Perch 3.0 - Bug - perch_content_create() wiped all data?
Hi,
This morning I think I uncovered a potential bug - I was updating a subsection of a client website domain.com/coreproduce/ which contains 4 pages:
- index.php
- potatoes.php
- onions.php
- carrots.php
I was adding a new line to the later 3 pages.
<?php perch_layout('product-forms'); ?>
The Product Forms layout php looks like this:
<section id="ProductForms">
<div class="flex">
<div class="form">
<h3>Download Brochure?</h3>
<?php
perch_content_create('Download', array(
'template' => 'download.html',
'searchable' => false,
));
PerchSystem::set_var('action', $_SERVER[REQUEST_URI]);
perch_content_custom('Download', array(
'template'=>'download.html'
));
?>
</div>
<div class="form">
<h3>Want to know more?</h3>
<?php perch_form('default.html'); ?>
</div>
</div>
</section>
Upon applying the update and visiting the pages all 4 pages lost their content / template information stored within the CMS meaning that it had to be reinput.
The same update was applied just before in another section with an almost identical structure and nothing unusual happened and everything updated as expected.
My gut instinct is that perch_content_create() somehow reset the section?
Thanks
Jason
That doesn't sound likely. What does debug output?
Hi Drew,
See below
index.php
potatoes.php
download region (which was generated by layout file mentioned above)
These are all control panel pages. Are you having a problem with those? Perhaps I misunderstood, but I thought the issue was with a page on your site.
Can you show me the debug from the page that isn't working?
Sorry Drew, My misunderstanding.
Just to clarify the page is now working correctly since the content was re-entered. It was just that when the new layout tag was placed in this section initially it caused the whole section and weirdly the index.php of this section which doesn't have this line to loose all the content.
Debug from potatoes.php
Ok. It's probably not going to be possible to debug what happened if you're already back up and running, but since there's no longer a problem we'll leave it there.
No problem - Thanks for your support as always!