Jump to content

MarkE

Members
  • Posts

    1,035
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by MarkE

  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; });
  16. The pageload is about 3 seconds, but the hook doesn't seem to affect it. Because fancybox loads almost instantly and displays a rotating wheel, I don't think the wait is a problem. The module checks page-editable before rendering. The hook then adds the permission.
  17. Obviously the user needs page-edit rights for the page in question. My approach to this was to write a hook after User::hasPagePermission which only gives them page-edit / page-add permission for the specific pages to which they are allowed access (i.e. in my app, their own membership records). If they try and access any other pages (e.g. directly in a browser, assuming they know the page-id or name, as the page in fancybox has modal=1, so no menu), they get a "You don't have access to edit" message.
  18. Fancybox works well on Windows and iOS. I have built a small module around it (a bit like a cut-down FEEL).
  19. Parallel to the approach I described above, I have also tried uikit's modal with an embedded iframe. This works adequately (and fixes the iPad issue with uk-overflow-auto), but there are a couple of snags - no doubt due to my incompetence: I can't work out how to make the modal/iframe height match the height of the embedded admin page - I can set the iframe width to 100%, but have to set a "hard" pixel height of, say 800, which may then leave whitespace for a small page. Because the target page for the iframe can vary (a range of pages may be edited), multiple modals/iframes are created via a loop (with toggle ids keyed to page ids). These then take about 15-20 seconds to load, which is not really acceptable. No doubt there is some clever way of avoiding this using jQuery, but I haven't worked it out yet. I will try some of the other suggestions as well. I also tried using the FEEL module, but that has the iPad problem too - see As mentioned there, I am not able to debug an iPad because I don't have a Mac. Similarly, @bernhard, I have no idea how to do a screencast on an iPad, but I can report the bug with a text description.
  20. Actually this seems to be a problem with the admin theme generally - for example, the tree panel in the uikit theme does not scroll on an iPad either. So looks like a bug.
  21. Well, whaddya know? Replace 'modal' by 'panel' and it works ... on a PC. But the iPad scrolling issue still persists (scrolls the background rather than the panel).
  22. Maybe, maybe not. If I could do an admin panel in the front end then I might be able to have an opinion ?
  23. This post is related to but is a different way of tackling the problem. The idea is to use the JqueryUI.module in the front end to present a restricted access admin page in a modal (class pw-modal). However the JqueryUI module doesn't seem to work properly in the front end (I have it working in the back end OK). I'm guessing that this is because the front end page has not loaded all the .js that is needed (that would normally be loaded in the back end). My _main.php loads the following from the core at the moment: 'wire/modules/AdminTheme/AdminThemeUikit/uikit/dist/js/uikit.min.js' 'wire/modules/AdminTheme/AdminThemeUikit/uikit/dist/js/uikit-icons.min.js' 'wire/modules/Jquery/JqueryCore/JqueryCore.js' 'wire/modules/Jquery/JqueryUI/JqueryUI.js' Any ideas what else I need, or have I got hold of the wrong end of the stick?
  24. Thanks - that's what I was looking for. Here is my final code for the hook: $p->name = $this->pages->names()->uniquePageName($p->name); $p->parent = pages()->get('/news/'); $event->arguments(0, $p); Works a treat!
  25. Thanks - that's effectively what I was doing, except in a before Pages::save hook, thus: $p = $event->arguments(0); //..some code here ..// $p->parent = pages()->get('/news/'); $event->arguments(0, $p); It works fine so long as the name does not already exist under the new parent. I seem to recall that the core uses a routine to add -1, -2 etc. but I can't find it.
×
×
  • Create New...