Jump to content

Search the Community

Showing results for tags 'processpageadd'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 2 results

  1. I took Ryan's old Page Edit Per User module and modified it to: Allow users to assign access on pages they have edit access on (and pages they create) Check a field on the page, and current user, and make sure there is a matching value (ex: multiselect field on both the user account and the page) Allow adding pages so long as they have access to a parent page Setup: Assign a role that has "page-edit" granted, but no templates are explicitly assigned to this access. A multiselect text tag field is assigned to both the user profile template, and any templates of pages that I want the ability for access levels to be controlled. (example values of tags: HR, PR, IT, Administration, ...etc...) When a user has a tag value assigned that matches a page's tag value, access to edit (and/or add) is granted. It's mostly working (from the page tree) (I thought it was, the add button is visible, but the same error is displayed when clicking it); I have one instance where a parent isn't displaying the add button for children, but I'll look at that shortly... What definitely is not working: the "Add New" button is (surprisingly) properly displaying templates of pages that users have access to add based on my changes, but once a user tries to use that button, it displays the following error: This makes sense since the role doesn't assign any explicit templates, but now I'm trying to override that. I suspect once I fix this that there will be another area I'll also need to hook, but... This message is part of ProcessPageAdd::___execute(). I tried to hook into `ProcessPageAdd::getAllowedTemplates` because in `execute`, it throws that error only if the template of the page to add isn't already defined in ProcessPageAdd::allowedTemplates. I might be going about this all wrong, but in the init() method of my adjusted PageEditPerUser, I have the following: wire()->addHookBefore('ProcessPageAdd::getAllowedTemplates', $this, 'hookAllowedTemplates'); ...and then the method: /** * ProcessPageAdd::getAllowedTemplates hook * */ public function hookAllowedTemplates($event) { // bd('hookAllowedTemplates'); // bd($event, 'event'); // bd($event->object, 'event->object'); // bd($event->arguments(), 'event->arguments'); $event->replace = true; $allowedTemplates = []; $allowedTemplates[input()->get->template_id] = templates()->get(input()->get->template_id); return $allowedTemplates; } One thing I struggle with, without others' examples, is what return value (and format) is expected from pre/post hooks. In this case I tried to completely replace the call to ProcessPageAdd::getAllowedTemplates because the value of $event->object->allowedTemplates in the post-hook is similar to a numerically indexed (by template ID) array of a template object (but contains a few more properties), but I still received the error as shown above. (I know I'll need to do more checks on the values assigned in the above method call depending on scenario; right now my tests all have valid parent and template IDs, so I just want to get that working first.) Any potential thoughts, either at what to look at, or where to further debug? (...or more code to share?)
  2. Hi, i have create a new template (as php file) for a second repeater solution and it works also fine at first without any problems. Then i have tryed to add a new page (from startpage) from the backend and suddenly i could only choose one option to assign a new template (only the template, which i created before). Now i have delete all (my new template, the fields and pages) and if i try now to add a new page from startpage, i get this error: DEBUG MODUS ABLAUFVERFOLGUNG ($config->debug == true): #0 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module(505): ProcessWire\ProcessPageAdd->isAllowedTemplate(NULL, Object(ProcessWire\Page)) #1 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(380): ProcessWire\ProcessPageAdd->___execute() #2 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array) #3 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageAdd), 'execute', Array) #4 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/ProcessController.php(337): ProcessWire\Wire->__call('execute', Array) #5 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(380): ProcessWire\ProcessController->___execute() #6 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array) #7 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessController), 'execute', Array) #8 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/admin.php(150): ProcessWire\Wire->__call('execute', Array) #9 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/modules/AdminTheme/AdminThemeUikit/controller.php(15): require('/var/www/vhosts...') #10 /var/www/vhosts/my-page.de/httpdocs/my-page.de/site/templates/admin.php(15): require('/var/www/vhosts...') #11 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/TemplateFile.php(287): require('/var/www/vhosts...') #12 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #13 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___render', Array) #14 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #15 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/modules/PageRender.module(536): ProcessWire\Wire->__call('render', Array) #16 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #17 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___renderPage', Array) #18 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #19 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/WireHooks.php(924): ProcessWire\Wire->__call('renderPage', Array) #20 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array) #21 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/modules/Process/ProcessPageView.module(213): ProcessWire\Wire->__call('render', Array) #22 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(383): ProcessWire\ProcessPageView->___execute(true) #23 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array) #24 /var/www/vhosts/my-page.de/httpdocs/my-page.de/wire/core/Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #25 /var/www/vhosts/my-page.de/httpdocs/my-page.de/index.php(55): ProcessWire\Wire->__call('execute', Array) #26 {main} I have checked all my configs, templates and pages in backend and can`t find anything that uses the "old" one template. Is there a default config/field in a database which i could reset? Any Idea , how can i fix this problem? Thanks for any help
  • Create New...