Jump to content


  • Posts

  • Joined

  • Last visited

About ErikMH

  • Birthday March 27

Contact Methods

  • Website URL

Profile Information

  • Location
    Vermont, USA
  • Interests
    The works of J.R.R. Tolkien, classical music, espresso, cartography, linguistics, keyboards (for typing), Macintosh (the Apple computer), cider-making (with lower-case apples), &c.

Recent Profile Visitors

444 profile views

ErikMH's Achievements

Full Member

Full Member (4/6)



  1. @teppo, it looks like this is precisely the module I was going to begin searching for on Monday. I’m wildly excited that you’re doing this, though I understand your warnings and cautions. My fingers are crossed!
  2. Fantastic little module, and I especially like the “magic” that happens when certain interpolated punctuation marks (“,”, “|”) are used between concatenated strings and one of the concatenated strings is blank: they’re left out! ? Would it be simple to add an ellipsis (“…”) to the list of characters so treated? My use case involves long paragraphs where I keep track of opening- and closing-words separately (in text fields), but I’d like to be able to represent the whole paragraph with Starting words … concluding words. Occasionally, there’s a very short paragraph, and I don’t want to imply that something has been left out (which an ellipsis, of course, does) — and in those unusual cases I include all of the text in the “starting words” field, leaving the “ending words” field empty. But (unlike with , and with |) the ellipsis shows up regardless.
  3. You just saved my bacon, @Robin S — thanks for this! For those searching, this is the secret sauce for presenting a subset of entries to select from, based on a previous selection. In my case: parent=page.refSection where refSection is a grosser-level selection in a hierarchy. I believe this also answers this question:
  4. Well, but that can’t be right. You posted this, with findMany() working just fine yesterday: So it looks like there’s something about getPage() (implicit or explicit), first(), and presumably last(), in combination with findMany(). I think.
  5. Excellent thought. I haven’t done this before, so hopefully I’ve got the details right: findMany() combined with getPage() gives pages whose parents are (incorrectly) NullPage
  6. OK, guys, it seems there was one more piece to the puzzle. Like @adrian, when I recreated the situation in a simple test environment running 3.0.192, I couldn’t recreate the problem. I should have tested this yesterday, but where I’d discovered that changing findMany() to find() in my code worked around the problem, I figured I’d found it. So, the following conditions are necessary but insufficient: PW 3.0.192 or greater (including the current version) page classes findMany() instead of find() I believe I’ve found the final ingredient. I have tested this in a simplified environment and recreated the problem: 4. getPage() In real life, I’ve rolled my own pagination (since I’d wanted to provide users with logarithmic-like controls for moving backwards and forwards through the site, and provide them with sign-post dates); this paginating has worked well. But it means that rather than a foreach loop I cycle through results in a for loop, and then assign the item with a getPage(). So, Adrian’s code looked like: foreach($pages->findMany('template-basic-page') as $p) { d($p->id . ' : ' . $p->returnParentId()); } but mine looks more like: $items = $pages->findMany('template=Test'); for ($idx = 0; $idx < 1; $idx++): $p = $items->getPage($idx); echo ($p->identify()); endfor; (Yes, that’s my test system, where I’ve hard-coded it to “loop” through just one test record; it’s sufficient to show the problem though: ProcessWire\TestPage #279 id: 1025 name: 'test-record-a' parent: '' template: 'Test' title: 'Test record A' data: array (1) 'title' => 'Test record A' parent there should = '1'. I see that I can do the same thing by removing getPage() altogether: $p = $items($idx); In the grand scheme of things, I don’t know which is better; however, this assignation — whether implicit or via getPage(), seems to be the final piece: add this, and $this->parent() becomes a NullPage. So, to sum up: all of this works fine in 3.0.150-or-so (where I developed it) on up through 3.0.191. As of .192, it breaks. Switching from findMany() to find() works around the problem. Sticking with findMany() and using the customary foreach() code pattern also works around the problem. Phew! @kongondo, I agree that the commit you link to looks relevant. Do you think the (implicit or explicit) getPage() may call any of that code?
  7. This is good to know about, @adrian — thanks for drawing my attention to it! No, though, 3.0.195 behaves just like everything else for me beginning with 3.0.192. If I use findMany(), I have the problem as outlined above; if I use find(), everything’s fine.
  8. Thank you, @adrian, for that pointer. I’d had no idea that JS hadn’t been running. I’ll look into your example soon! But the big news is that I’ve solved the problem! @ryan, @bernhard, & @kongondo — thanks to each of you, too, for your encouragement and good ideas! Essentially, there is a bug, but it only presents itself when using findMany() instead of find(). As of 3.0.192, if you assemble a batch of pages with findMany() , and then call a function defined in a page-class definition on one of those pages, the $this variable in that function will have an empty parent property. By contrast, in 3.0.191, the $this variable in that function will have the proper value in its parent property. And also by contrast, in both 3.0.191 and in 3.0.192, if you use find() instead of findMany(), the function will have the proper value in its parent property. So, the bug shows up only in 3.0.192 or later and you’re using findMany() and you’re trying to find any parent-based information from the perspective of $this within a function of a page-class definition. For my own use today, I’m perfectly OK using find() instead of findMany(), though there may come a time when I’m dealing with too many records for that to work gracefully. So I can upgrade beyond 3.0.184! Thanks again to everyone for your help; I’ve learned a lot through this process. If an admin would like to break all this out (it has nothing to do with Ryan’s original post — I meant to reply initially to his announcement of 3.0.192!), I’d be grateful
  9. Oh, bingo — you called it! sam.example.org/:1 Refused to load the script 'https://sam.example.org/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'nonce-MzlhOGMzOWY0OTdkMDIxMmZkZDRiNTE0ZDBiYTg3YzI=' 'strict-dynamic'". Note that 'strict-dynamic' is present, so host-based allowlisting is disabled. Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. I’m out of my ken here, @adrian. I see that something is set to be more secure than optimal, but I’ve no idea where to make a change. Cloudflare is mentioned — do you think that’s because it’s really where rocket-loader is served from, or because I have Cloudflare guarding my cloud-based development machine too well? Or is that not a fruitful line of inquiry? This of course isn’t the serious problem that I need to resolve, but I’m glad to get these little points of friction worked out too. Thank you!
  10. Well now that’s very strange. I see exactly what I posted here, both in a WebKit browser and also in a Chromium-based browser — both of which have Javascript turned on. I thought perhaps there might be an invisible checkbox, but the pointer doesn’t change when I hover in that area, and clicking does nothing. But it doesn’t really matter for the problem at hand; I won’t worry about this for now. Thanks!
  11. Wow, I don’t see anything like this at all. Here’s the top of my screen: and here’s the bottom: [I’m also unsure as to why my posted images keep being magnified so much larger than everyone else’s. I apologize!]
  12. I’m not sure what you’re suggesting? I’ve backed up, made changes, tested, restored from backups countless times over the past eight weeks on my development installation. Whenever I need to update data in the live site, I’ve restored the development site to the last master release, added my new data, and then cloned everything over to the live site.
  13. No effect. ? BTW, I saw no way to “select all” the tables, so I clicked on each (there are 95) manually to select them all. Is there a better way? My future self thanks you!
  14. I’ve never run across that before! It looked likely, but has no effect.
  • Create New...