Jump to content
Michael Murphy

Problems deleting pages used by a PageTable and PageTableExtended field

Recommended Posts

I am having problems deleting pages used by a PageTable and PageTableExtended field



Processwire version :  2.5.8 dev


Modifications : I have installed Language support for Fields and Page Names.



This issue affects the PageTable and PageTableExtended modules - they are both slightly different but maybe connected somehow. That could be because of the whole interconnectedness of everything or because they have almost the same name. 



With the PageTable


I am storing the PageTable pages in a hidden folder called "Videos".


If I delete one of these pages outside of where the PageTable is being used (i.e. from the "Videos" folder) the following happens :



If I am logged in as root admin, the deleted PageTable page is greyed out, I can open the page and edit, but there is a message that : 



This page is in the Trash

And there is no way from this dialog to restore the page (of course you can go manually to the trash and restore it).



If I am logged in as an editor (with reduced permissions but including "page-delete") - the deleted PageTable page is greyed out, but when I try to edit the page, there is an error message. 



Module ProcessPageEdit failed init - You don't have access to edit
No page found

And it is not possible to edit the page.



With the PageTableExtended



I am storing the PageTableExtended pages in a hidden folder called "Content Blocks". 


If I delete one of these pages outside of where the PageTable is being used (i.e. from the "Content Blocks" folder).


When logged in as root admin and also as an editor (with reduced permissions but including "page-delete") I get the following error when trying to edit the page where the PageTableExtended is being used.



Page '/en/trash/1743_content-block-36/' is not currently viewable.

The only way to allow them to edit the page again, is to go into the trash and restore the deleted content block back to it's original location (the "Content Blocks" folder).



Thanks for any help!


Share this post


Link to post
Share on other sites

@Michael Murphy - i know it sounds sort of Yoda, but perhaps don't delete the pages except with the pagetable? that would prevent that issue; don't give trash/delete permission to those roles that might see the error?

  • Like 1

Share this post


Link to post
Share on other sites

Hi Macrura,

That is what I have told the editors to do for now until I work out what is wrong.

The reason I would like to do this is because I want to allow the editors different ways of managing the content outside of the PageTable field context. 

First I have added some helper links on the front end that allows editors to easily edit the PageTable pages.

I have also setup some Lister pro saved searches for certain PageTable pages (I call them "Content Blocks") like for "Video blocks" and "Image blocks" - so an editor can easily change any of the videos or images from the Lister view (almost like a media manager).

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By louisstephens
      So I ran into a very strange issue today. I have a template with a pagetable and I went to add an item to it, when I went to select an image (for an image field) the page instantly threw up an error
      "ProcessPageSearchLive: No search specified"
      The page's content also switched to the image attached. This all worked perfectly last week (local mamp box). Has anyone experienced this before, and how did you solve it?
       

    • By jploch
      Hey folks,
      I have a question regarding rendering of template files that are in a subfolder of the template folder.
      How would I for example render these PageTable items, when their template files are inside templates/blocks/:
      <div class="grid"> <?php foreach($page->grid_ext as $item): ?> <div id="pteg_<?= $item->id ?>"> <?php echo $item->render(); ?> </div> <?php endforeach; ?> </div> I tried this, but get an error:
      <?php echo $item->render(wire('config')->paths->templates . '/blocks/'); ?>  
    • By tron1000
      Hello! I use PW 3.0.98 and I have frontend editing enabled for a PageTable Field. Somehow, when I double click the field in the frontend, the iframe in wich the content is displayed is very small (see screenshot). I couldn't find out if thats some CSS conflict or another problem. Any suggestions? Thanks, Andrej
       

    • By Noel Boss
      I use a PageTable field to make edits to children of pages more intuitive…
      To register the hooks, insert the following Snippet inside your init function in your module (or add it to your init.php file):
      /** * Initialize the module. * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. */ public function init() { // Prefill pageTable field $this->wire()->addHookBefore('InputfieldPageTable::render', $this, 'addChildrenToPageTableFieldsHook'); $this->wire()->addHookBefore('InputfieldPageTableAjax::checkAjax', $this, 'addChildrenToPageTableFieldsHook'); } Then, add this hook method:
      /** * Fill pagetable fields with children before editing…. * * @param HookEvent $event */ public function addChildrenToPageTableFieldsHook(HookEvent $event) { $field = $event->object; // on ajax, the first hook has no fieldname if (!$field->name) { return; } // get the edited backend page $editID = $this->wire('input')->get->int('id'); if (!$editID && $this->wire('process') instanceof WirePageEditor) { $editID = $this->wire('process')->getPage()->id; } $page = wire('pages')->get($editID); // disable output formating – without this, the ajax request will not populate the field $page->of(false); // you could also insert a check to only do this with sepcific field names… // $page->set($field->name, $page->children('template=DesiredTemplate')); // just specific templates $page->set($field->name, $page->children); } Now whenever there is a page-table field on your page, it gets populated with the children
×
×
  • Create New...