Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

26 Excellent

About MarkE

  • Rank
    Sr. Member

Recent Profile Visitors

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

  1. Ah thanks - not a PW issue at all - it looks like my hosting service has reduced upload_max_filesize to 2MB 😬
  2. Maybe I'm being a bit dim and this is quite simple, but I just tried to upload a pdf file (to a field of type "Files") and got a message saying there is a 2048k limit. However, I had previously (some months ago) uploaded a similar file which is still there and is 3MB. (Version 3.0.123)
  3. I have the same problem - I think it is caused by some email clients placing <style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style> inside a <head> tag. Something then deletes the <style> tag. The culprits could be any of: this module HTMLpurifier for the textarea field CKeditor Unfortunately, I have not been able to replicate it with my email client, so checking where the problem is has been tricky. I think that it is most likely (1) or (3) or both. To eliminate (3), place style{display} in the CKeditor "extra allowed content" of your textarea field (input tab). If it still happens, you could try hacking lines 511 and 514 of ProcesEmailToPage.module to include <style> in the list of allowed tags. Let me know the results, Ta. UPDATE: Hi @cstevensjrI managed to create a test email using gmail and developer tools. I think you need to fix both 1 & 3 as per my suggestion. You will see from my previous post that I have suggested a module change to avoid trapping tags like this.
  4. Hmm... I think the sanitizer itself works as you say. There's something else interfering which I don't understand. For info, my use case is to distribute emails from committee members to other committee members and keep a central repository, so there are several steps in the process - the module, email clients and PW core (plus my own code) - so finding the culprit is proving a bit tricky. The body field I am using has HTML Purifier enabled, so using it in the module doesn't really do anything (apart from seeming to add spurious <p> tags). As regards amendments to the module, on reflection, it seems that there are several possibilities for adding options: Further allowed tags Set stripTags =>false Use sanitize-purify rather than sanitize->textarea Don't sanitize (rely on host field sanitization) .. and maybe more. Given this, it might be best to wait and see what @Pete thinks.
  5. Thanks @adrian - At the moment, I have simply added the tags <ol>, <ul> and <li> to the allowableTags in lines 510 and 514. I haven't created a configuration option. I think it might be better, however, to adapt the existing "inline images" option to be a "rich text and inline images" option, using sanitizer->purify rather than sanitizer->textarea. I've struggled to code this, however, as I am unsure about the options in sanitizer->purify. I thought it should work without any options but, although it allows rich text, it doesn't seem to like the inline images and I can't see how to make it permit those.
  6. Any reason why the sanitizer is used to strip all but the most basic tags from the emails? I just realised that it strips <ol> <ul> and <li>. I've hacked my copy to fix this, but would it perhaps be better to set the allowable tags as an option, with the basic ones as default?
  7. It didn't mess with the sessions - just the logs. I'd set parameters to turn custom debug logging on/off and it was turning off more than it should 😳 I still don't know why the sessions weren't expiring, but it may be because I had a log page open and it was constantly refreshing. So all in all, pretty dim ...
  8. A case of exceeding dimness on my part - one of my hooks not functioning properly.
  9. This may be quite simple, but I'm foxed: ProcessWire no longer seems to be logging any login/out events to the session log (e.g. manual sign out or sign in). Also it seems to have stopped expiring my session. The session limit seems to be 1 day still. I can't see anything odd in PHPinfo. Any ideas why or where to look? EDIT: Curiously, session expiry happens on my iPad (Safari), but not in Chrome on Windows.
  10. Thanks for the linked discussions - I hadn't seen those. I do agree that "absolute" in the options needs clarification. Looks like I'll need to do a bit more php...
  11. I'm using PWlink in CKEditor.
  12. Hmm. I have that set to absolute 🤔
  13. The link insertion provided by CKEditor in ProcessWire gives an option to link to a page as well as an external url. This works fine when used in a field that will appear in the website, but, as it is a relative url, it does not work if clicked from outside the site. I am creating email texts in a Processwire page and then sending them. If I link using the "select page" option then the link does not work for the recipient. Is there a simple way of fixing this or do I just have to remember to put in the full link manually (or write some code to parse and enhance the email text)? The same problem occurs if linking to a file.
  14. Hi @teppo, I'm using version 1.2.9 from the modules library and having trouble with the UI: for fields that are on the left of the screen, the popup "compare" is off-screen and unusable (using UIkit). It looks like version 2 has a better UI. Is that going to make it to the 'official' library some time soon or do I need to install it from GitHub? If I do need to install it "manually", how do I do this without losing my settings and history. Thanks.
  15. The module can be found at https://github.com/MetaTunes/AdminInModal Use at your own risk! The hook is specific to my app, but I hope the following gives the general idea: wire()->addHookAfter('User::hasPagePermission', function(HookEvent $event) { // Get the object the event occurred on, if needed $user = $event->object; // An 'after' hook can retrieve and/or modify the return value $return = $event->return; // Get values of arguments sent to hook (if needed) $permission = $event->arguments(0); $p = $event->arguments(1); /* Your code here, perhaps modifying the return value */ // Is it a page we need to customise access for? $templates = ['Membership', 'Member', 'Profile', 'Subscription', 'Payment', 'MemberShop', 'Booking', 'NewsItem']; $permissions = ['page-edit', 'page-add']; if ($p and in_array($p->template, $templates) and $permission and in_array($permission, $permissions)) { // Get the member-user $currentUser = $this->users->getCurrentUser(); if ($currentUser and $currentUser->isLoggedin()) { if ($currentUser->hasRole('member')) { $email = $currentUser->email; $memberPage = $this->pages->get("has_parent=/memberships/, template=Member, email=$email"); if ($currentUser->memberOnly) $return = false; // Member-only users can only access pages as defined below if ($memberPage->id) { $membershipPage = $memberPage->parent; //... and a lot more like that ($profilePage etc.) ... $editablePages = new PageArray(); $addablePages = new PageArray(); $editablePages = $editablePages->add($membershipPage)->add($profilePage)->add($siblings)->add($currentSub)->add($shops)->add($subsPaymentPages)->add($draftNewsPages)->add($bookingPages); $addablePages = $addablePages->add($membershipPage)->add($memberPage); // pages where creation of children is allowed if ($editablePages->has($p) and $permission == 'page-edit') $return = true; if ($addablePages->has($p) and $permission == 'page-add') $return = true; } } } } // Populate back return value, if you have modified it $event->return = $return; });
  • Create New...