Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

23 Excellent

About Lars282

  • Rank

Profile Information

  • Gender
  • Location
    London, UK; Frankfurt, Germany

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi. For some reason, without doing any changes on my part to the PW install over the last 2 years, the image extra field that I had set up disappeard just now from the edit page: I have setup the image field with a custom text input as follows: But I do not see this with the image when editing a page: In the database, the field is available and filled for all "old" pages that were created a while back: [Note: I have just now, after the issue occured, manually changed the default in the table from None to "" as it otherwise would not have allowed me to upload any new images] Did anyone encounter this before? How do I get the field back to show when editing pages? Any help would be highly appreciated! Best Lars
  2. I haven’t touched the install at all ... Where do you see this? Is there a (temporary) „quick fix“ that you can see? Change this column to optional? Change the database column to accept null values and put default to null? Will also move this to the image extra spaces. Thanks a lot for your help, highly appreciated!
  3. Hi. I am suddenly receiving an error on a production site that has worked perfectly over the past years. When uploading an image to a field called article_images, I receive the following error: I had set up this field to accept an additional value for "Credits" with each image: This is also reflected in the database: I have not made any changes to the setup/settings in the past years. Does anyone have an idea on where this could be coming from now and how to fix it? Any help would be highly appreciated! Lars
  4. Thanks! Seems to be the issue that render check if the page is viewable, as when the page is in any other status, the code works fine. Still surprised that this returns a 500 internal server error. If $page->render checks if the page is viewable, is there any other way to display an unpublished page? Publishing and keeping the page hidden might work, but will involve additional steps of hiding / unhiding the page ...
  5. Hi, I am trying to give my editors the option to share unpublished pages with externals for review, without moving or copying the actual page in the admin. I have now created a draft template, that has one field (a page). Whenever the draft template is accessed, it should render the page selected in that field. This works fine as long as I am logged in. When I am not logged in, the $page->render() on the unpublished pages leads to 500 internal server error. Any idea why? Below the code I am using. Can I use $page->render() on unpublished pages? Thanks! Lars <?php if($page->draft_article) { //draft_article is the field where I select the article to be shown $out = $page->draft_article->render(); //when the page selected in draft_article is unpublished, guests get a 500 error with this line echo $out; } else { echo 'No article selected.'; } ?>
  6. So I have created a small module to do this. In addition to preventing users from logging in, I also want to log out everyone, but cannot get this to work - does anyone have an idea why it does not log users out with the code below? Preventing login works fine. Am I hooking wrong? Thanks! <?php /** * */ class SessionLoginDisable extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Session Login Disable', 'version' => 001, 'summary' => 'Provides option to disable login for all users except superusers.', 'author' => 'Lars Bergemann', 'autoload' => TRUE, 'singular' => TRUE ); } public function init() { $this->addHookBefore('Session::allowLogin', $this, 'allowLogin'); $this->addHookAfter('Session::isValidSession', $this, 'isValidSession'); //no effect currently $this->addHookBefore('ProcessLogin::execute', $this, 'disableLoginNotice'); } public function allowLogin($event) { $name = $event->arguments[0]; $user = strlen($name) ? $this->wire('users')->get("name=$name") : null; if(count($this->disable) > 0 && $user && $user->id && !$user->isSuperuser()) { $event->replace = true; return false; } return null; } public function isValidSession($event) { if ($event->return) { $userID = $event->arguments[0]; $user = wire('users')->get($userID); if (count($this->disable) > 0 && $user && $user->id && !$user->isSuperuser()) { $event->return = false; } } } public function disableLoginNotice($event) { $this->error("Login currently disabled."); return null; } }
  7. The maintenance mode module handles this on a per role basis so far more than what I would need. I'll use the hack for now and might make a small module for the future.
  8. Hi all, Is there a way to easily lock out all from login into the admin except superusers? I could not find anything on this issue. I could write a small module, but I am sure that i am not the first person that needs this? We have a larger site with multiple users maintaining content. I want to copy the entire site to a staging server, make some changes (setup of fields), test them, and copy the site back to production. I want to temporarily lock all users out so that the content does not change on production system between the copies. Or is there a better way to do this? Thanks Lars
  9. For the PageTable field, when allowing lots of templates, I think there should be some space between the rows of buttons. See for example:
  10. disallowedContent: *[*]{*} is what I would use. Does that make sense?
  11. Maybe I just don't get it ... but following this logic, how do I strip all style attributes from all tags? Would *[*]{*} work? Edit: seems to work - or do you see any issues with this?
  12. I have tried adding disallowedContent: *[style] to the Custom Config Options with ACF on, but it throws a JSON validation error. Where am I wrong?
  13. For a PageTable field, I have selected multiple templates that are allowed as items, and I entered an automatic page name format. It seems that even though this can be entered, the automatic page name format only applies in the same circumstances as for when adding pages, i.e. when only one template is allowed as child. 1. I would suggest to add the following to the description for automatic page name format entry for PageTable fields: "In order to work, a single (1) template must be selected for the "Select one or more templates for items" field on the Details tab." 2. How can I get around this restriction? It is for maintaining parts of a page, where the name really does not matter at all - and it is only confusing my users that they need to enter just anything to proceed. I am assuming this will be "solved" for PageTable fields as soon as it is "solved" for adding pages in general - I looked into this before but go stuck: https://processwire.com/talk/topic/9979-name-format-for-children-for-multiple-allowed-templates-for-children/ Can someone help on where to hook to in order to also "catch" pages that allow multiple templates as children in order to jump the Add Page screen? Thanks a lot!
  14. Is there already a way to hide the 'new' button next to pages where it is not allowed to add new child pages (as no templates allowed)? Or is this on the roadmap somewhere? This would be to prevent this error from ever showing to an admin user:
  • Create New...