Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


MarkE last won the day on April 12

MarkE had the most liked content!

Community Reputation

50 Excellent

About MarkE

  • Rank
    Sr. Member

Recent Profile Visitors

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

  1. MarkE


    Any idea how I can use an image which is inside a pagetable to populate the og:image property?
  2. OK - I've debugged the issue, although I never understood the exact sequence. FWIW, without going into details, I learned two things about ProcessWire while debugging this: If you are signed into mysite.com, this does not mean that you are signed into www.mysite.com although they are the same PW site. If a template has caching turned on, it does not detect if the the request method changes from GET to POST (with variables supplied) or if new/changed GET parameters are supplied. I don't know if these behaviours are intentional but they both caught me out. In particular, I'm surprised that PW doesn't serve up a new page with a POST.
  3. I'm trying to debug a weird issue with POST variables disappearing. For some reason this only happens when the url of the page with the form is www.... as opposed to the canonical form. I have placed a trap in various places (the trap is just to test for $_SERVER['REQUEST_METHOD'] == 'POST' and, if true, var_dump($_POST) and exit) with the following results: in ready.php the dump executes and the POST vars are there in _init.php the POST vars are no longer there if I hook Page::loaded, the POST vars are not there So the vars are getting lost between ready.php and Page::loaded. I'm afraid I don't know PW well enough in terms of what happens in between these, so I don't know where to place my trap next. Any suggestions? EDIT: if I hook after PageRender::renderPage, the POST vars are there. So what happens between PageRender::renderPage and Page::loaded?
  4. MarkE

    Hanna Code

    All my hanna codes return $hanna->field as: id => 0 name => "" label => "" flags => "" type => null Any ideas why? The other properties ($hanna->name and $hanna->value) are fine (contents shown are from Tracy - bd($hanna)) Solved - just being a bit dim and not realising that I need to pass the field explicitly in the API - it doesn't infer it from the context.
  5. I'll take a look. Meanwhile, I'm doing a work-round to try and avoid needing each(). Thanks.
  6. It appears that RockLESS uses LESS version 2.5.3. I am wanting 3.7 so that I can use the each() function. Is it possible to upgrade? Thanks.
  7. Problem solved (sort of): The problem is caused by the HannaCodeDialog iframe effectively removing the <div id="dm-editor-content"> from the current DOM. This causes an error in Desigme as ACE can't find #dm-editor-content. Ideally, Designme should detect that #dm-editor-content is missing and not call ACE. My temporary inelegant fix/hack is to add <div id="dm-editor-content"></div> to the HannaCodeDialog iframe_form.php. Maybe someone cleverer than me can suggest the best way of fixing Designme (in designme.editor.js - the problem is line 58) 🙂 EDIT: In the absence of better ideas, I have modified design.me.editor.js as follows (line 419 et seq) $(document).ready(function(){ if ($('#dm-editor-content').length) { designme.editor.init(); } }); @elabx - Is this on Github or some such for PR (I have 2 mods now) or do users just keep their own branches?
  8. No! Don't do that - instead add $out = ''; at the beginning of the renderFileTree function.
  9. Having got it working, I'm pretty impressed. The only problem so far is that the js (something in Designme.2.js) interferes with an InputfieldPageListSelect in the site I am testing it on. This is not a standard PageListSelect field (those seem to be OK), but one in an iframe created by a hanna tag attribute input using HannaCodeDialog. I have a hook thus: wire()->addHookAfter('HannaCodeDialog::buildForm', function(HookEvent $event) { // The Hanna tag that is being opened in the dialog $tag_name = $event->arguments(0); // The form rendered in the dialog /* @var InputfieldForm $form */ $form = $event->return; if($tag_name === 'ImagePage') { $modules = $event->wire('modules'); // Generate page list $f = wire()->modules->InputfieldPageListSelect; $f->set('parent_id', 1025); $f->name = 'imagePage'; $f->id = 'imagePage'; $f->label = 'Select image page'; $form->add($f); } }); (thanks to @Robin S for the idea). This hook enables me to select image pages with additional metadata (e.g., caption, url) which is then rendered by the template. Without Designme installed, the interactive attribute entry works correctly as a page list select. With Designme, it just shows a text box with the imagePage id. Turning off Designme.2.js also fixes it, without doing a complete uninstall (but obviously, then Designme does not work!).
  10. Ta @bernhard - $this fixes that error (without adding namespace), but there seem to be other issues. $out on line 68 of inc/sidebar.php is 'not defined' - I'll investigate more, but I'd be interested if anyone else has had to make changes, or whether it might be something to do with my environment. (I downloaded the files from the zip link that was posted above). Edit: Just replace $out .= by $out = on line 68 and it all seems to be working. It looks interesting - could speed up dev time quite a bit - but need to use it for a while to see.
  11. I'd already done that it just changes the message from "Call to undefined function _(), did you mean d()?" to "Call to undefined function _(), did you mean processwire\__()? " Edit: if I add wire()-> then the error goes (until the next _(‘...’) ). I could try doing that throughout but it seems like there ought to be a better answer than hacking the code like that.
  12. I'm just trying out the module below and am getting the error "Call to undefined function _()" on the line $untaggedLabel = _('Untagged'); I suspect this is something to do with my config, not the module (hence posting it here), as others have installed the module with no problems. Any clues? Module is
  13. Have you tried wire()->addHookBefore('Pages::save', function ($event) { $p = $event->arguments(0); // Get the previous version of the page $oldPage = wire('pages')->getById($p->id, array( 'cache' => false, // don't let it write to cache 'getFromCache' => false, // don't let it read from cache 'getOne' => true, // return a Page instead of a PageArray )); Then you can compare the old and new.
  14. A bug? (version 1.1.2) On selecting a subfield in a lister and typing in the value to match, I get the error "Call to a member function isEmpty() on string" for line 55 of FieldtypeStreetAddress.module
  15. This is a really useful module. I have only had one issue so far - the default country setting in the field config page does not seem to work in the API. I have to set (e.g.) $this->address->origin_iso = 'GB'; for it to be effective.
  • Create New...