juek / CustomSections

Developer plugin for rapid prototyping of custom section types in Typesetter CMS
GNU General Public License v2.0
3 stars 7 forks source link

"Recreate custom sections" disruptive action #51

Closed mahotilo closed 4 years ago

mahotilo commented 5 years ago

It looks like we need open-edit-save all custom sections after press "Recreate custom sections". Otherwise, all internal variables that used i.e. $page->title will have incorrect values. Can the process of adding new fields during recreation be less disruptive?

a2exfr commented 5 years ago

May be set this option to true can help $section['always_process_values'] = true;

mahotilo commented 5 years ago

Tried it. Doesn't help.

I have lines like this in my section.php

$pageURL = \gp\tool::AbsoluteUrl($page->title,'',true,true,true);
$section['content'] .=$pageURL;

If I press "recreate custom sections", $pageURL will be only <site name> without page name, or <site name>/Admin_CustomSections?cmd=recreate_custom_sections&page_to_refresh=test sometimes. After "open-edit-save" of my custom section $pageURL again is actual page URL.

Now I have simply commented link "recreate custom sections" to prevent accidental recreate and then dozens of "open-edit-save" of my custom sections. It i snot a solution, only some kind of "protection".

mahotilo commented 4 years ago

Now, I suppose it was related to the "Oops, not a draft" error. This no longer happens to me with the latest TS, so I think the issue may be closed.