Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


MarkE last won the day on January 2

MarkE had the most liked content!

Recent Profile Visitors

2,666 profile views

MarkE's Achievements

Hero Member

Hero Member (6/6)



  1. It works for me too in a similar context - i.e. when calling it to output: i.e in {$page->foo()} - but not when called in a variable declaration - ie. {var $foo = $page->foo()} That's when I seem to need {var $foo = $page->ProcessWire\foo()}. Odd. EDIT - Correction: The issue occurs not with page classes but just with functions defined in init.php (which is in the ProcessWire namespace.
  2. I do love Latte, but one little thing is puzzling me at the moment: namespaces. I am using custom page classes for all my 'business logic' - e.g a method getEmailHash() in the custom page class called in the Latte script with $page->getEmailHash(). The class has the namespace ProcessWire. It seems that I always need to specify the namespace in the method - i.e. $page->ProcessWire\getEmailHash(). Is there a way of avoiding this?
  3. I've only just spotted this but, in my ddev environment, if I modified a page the modified date was always recorded as one hour earlier. So appears on the settings tab immediately after doing a modification (at 14:55). The production environment was OK. I have $config->timezone = 'Europe/London'; throughout in config.php. It seems that you also need to set the timezone (in my case 'timezone: Europe/London') in the ddev config.yaml
  4. Thanks @Robin S - I think that's an improvement (although I'm not sure if it may be slightly less efficient). However, it doesn't really solve my problem: I realise after sleeping on it that my code is actually setting both sides of the pair anyway and so may be conflicting with ConnectPageFields. I changed my code to save the page with 'noHooks' => true and it all works fine. It also fixes the earlier problem, so I'll update your issue for that as it was proving difficult to tie down the source of the null page. 'noHooks' may have side effects, however, and I'm wondering if I can just temporarily turn off ConnectPageFields. EDIT: not updated issue as the issue description perfectly explains the problem outside my context
  5. Hi @Robin S. I'm still investigating this. However, in the course of my investigations, I discovered another problem I was having with the ConnectPageFields::updateConnectedFields($page, $field) method. What I understand happens is that the entire array of connected fields which pair with the field on the page is run through and an update occurs if the page passes the 'isValidPage' test for the other field. Unfortunately, 'isValidPage' also sets an _isValidPage attribute (error message) which then seems to 'stick' on the page. In my particular usage, this seemed to prevent the valid 'other field' (which occurred later in the connected fields array) from updating. I'm probably being a bit thick (it is a bit late here) but I don't see why fields are attempted to be updated when they don't exist on the page. I added if(!$page->hasField($other_fname)) continue; after line $other_fname = $other_field->name; and everything seemed to update fine. I can provide more background to the situation if required. EDIT: Actually that last bit is not the right solution, but I need to sleep on it!
  6. Hi @adrian. I just tried to use this module for the first time and hit a snag. If a config field references a page, then the module uses the page id as the value. Fair enough, but it does not work if the target environment has different page ids (which may be the case if your development database is not an exact clone of the production database - in which case you probably don't need this module anyway). In my ProcessDbMigrate module, I get round this by converting ids to paths (and providing a mapping if the paths have changed - which is far less likely). I was going to add a module migration component to ProcessDbMigrate, but then came across this module which I thought would do the trick. Is it possible to modify ModuleSettingsImportExport, or am I best to go ahead with my original plan and extend ProcessDbMigrate, in which case, can I 'borrow' a bit of code from your module (with accreditation)?
  7. Interesting topic and also interesting to compare the various CMSs at https://openalternative.co/categories/cms. Unfortunately it is not possible at-a-glance to see what is a pure CMS and what is more of a framework. The initial attraction of ProcessWire to me was that it combines the ease of use / UI of a CMS with the power and flexibility of a framework. This means that you can build a fully functional custom app but still enable non-technical editors to access the content they need. Which of the “ProcessWire-like” CMSs do that?
  8. I'll investigate. I suspect it may be connected with an export method that never seemed to have been completely finished although part of the core.
  9. Thanks @Robin S. I also got this error (after the fix), which might be related: As you can see, it seems to be caused by a null item being included in an implode. I'm seeing if I can fix that too. Update: Added this after line 125, which seems to fix it: // Remove any null pages and continue if the new value is empty if(!$new_value) continue; if($new_value instanceof PageArray) { foreach ($new_value as $valueItem) { if ($valueItem instanceof NullPage) { $new_value->remove($valueItem); } } if($new_value->count() == 0) continue; if($new_value->count() == 1) { $new_value = $new_value->first(); $this_is_multi = false; } } else { if($new_value instanceof NullPage) continue; } I'm not sure how the null pages were getting in there - probably something specific to my set-up - but hopefully the above code doesn't have any side-effects.
  10. Hi @Robin S, I just had the following error message: I'm not sure exactly what caused it, but changing line 144 to if(!$item->fields || !$item->fields->get($other_fname)) continue; seemed to do the trick
  11. Have you tried giving the editor role page-sort permission on the parent template?
  12. One way, if your parent pages have different templates and their children should also have distinct templates, is to use the template family settings. Otherwise I think you may need to hook Pages::moveReady - see https://processwire.com/api/ref/pages/move-ready/
  13. One solution is simply to add {"toolbar_location": "bottom"} to the JSON default overrides in the module config, but I don't really like it.
  14. Sorry to say @bernhard, that I seem to have run out of road on this one. I compared two identical windows, one showing it correctly and the other not. The css was identical and there were no media queries. I compared the html and there are very minor differences in some of the width settings, which you can see being changed by js as the window is dragged between screens. The main one was this div: <div role="application" class="tox tox-tinymce tox-tinymce-inline tox-tinymce--toolbar-sticky-off" aria-disabled="false" style="visibility: hidden; display: flex; position: absolute; left: 10px; top: 826px; width: 591px;"> which is the html on the 'correct' rendering and this: <div role="application" class="tox tox-tinymce tox-tinymce-inline tox-tinymce--toolbar-sticky-off" aria-disabled="false" style="visibility: hidden; display: flex; position: absolute; left: 11px; top: 830px; width: 591px;"> which is the rendering with the drop-down above the icon line (which is what causes the problem). All the other width changes appeared to be fractions of a decimal and there were no other html differences. I manually changed the 'bad' html to be the same as the'good' html using developer tools, but there was no noticeable effect. So I am pretty much stumped. Maybe @ryan, who must have a deeper understanding of what the js is doing (much of it is minimised) could shed some light?
  15. Hi @bernhard. It's really weird. If I move a window from one screen to another, the problem fixes itself. Move it back to the original screen and it reappears. What is happening is that the 'bold' dropdown you can see in the image I posted appears between the menu and icon lines, causing the bottom of the toolbar to drop down. When I move the window to a different screen the 'bold' dropdown is displayed inline with the icons. This is with no interaction other than simply dragging the window, so it looks like maybe a css issue? Still looking....
  • Create New...