Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

51 Excellent

About johnstephens

  • Rank
    Full Member

Recent Profile Visitors

5,765 profile views
  1. Excellent, thank you @bernhard! That was exactly what I needed. I’m glad I didn’t have to manually like them to files imported in bulk with filesManager->importFiles().
  2. Hi! I want to import files into a specific ProcessWire page that has a "files" field. I wrote this snippet and it successfully copies the files to the correct directory under /site/assets: const PATH_PREFIX = '/path/to/files/'; $parent = pages()->get('/my-files-page'); $parent->of(false); $parent->filesManager->importFiles(PATH_PREFIX); $parent->save(); But I also want the files to show up in ProcessWire’s admin panel for that page, linked to the "files" field. Having done this with images, comments, and page reference fields, I know that it involves iterating
  3. Thanks again, @wbmnfktr! Hidden characters was one of my thoughts too. I see that all the hidden characters exposed by these two sites are also visible by default in my Vim configuration: spaces and linefeeds. Comparing both the original content and the version that works after my unsubstantial revisions using those two sites, I don't see any significant difference between the problem version and the working version. The problem version didn't have any suspicious hidden unicode characters or sequences that these tools exposed. I'm still stumped, but at least now I know some new angle
  4. It seems to be fixed. I don’t know why. What I did was copy the Source markup from the CKEditor field into Vim and scour it. Since the content had a lot of link anchors, I added new lines around each one so that I could see them separately. But then… I found nothing unusual. I added blockquote tags around one paragraph that was a quotation, and I switched a few em tags to cite since they were book titles, and I changed a few straight quotes (") and apostrophes (') in the markup to the curly versions (“, ”, and ’). I pasted the result back into CKEditor's Source panel and saved the pa
  5. I narrowed down the issue again, but I’m not sure what it means. I’ll do some more testing and see if I can turn up something. Here’s what I found: I duplicated the page again by creating a fresh page with the same template, just like before. The only content in the original page was a title and CKEditor field, so I copied the title first and tested it before copying the CKEditor field content. It worked! The navigation link appeared as expected on other pages and on the page itself. Then I copied the original content from the CKEditor field into the new page's CKEditor field an
  6. I’m not aware of the database ever crashing, but I don't know how I would detect that. I've never seen this in a ProcessWire project either. Here is the how the page reference field is configured: { "navigation_main": { "id": 130, "name": "navigation_main", "label": "Main navigation menu", "flags": 0, "type": "FieldtypePage", "description": "Select pages for main navigation menu", "derefAsPage": 0, "inputfield": "InputfieldAsmSelect", "parent_id": "/", "labelFieldName": "title", "collapsed": 0,
  7. Since the github issue references saving the page, I guessed that this might be associated with using the PageFrontEdit module on this site. As a test, I uninstalled PageFrontEdit, and there was no effect. Still unclear on the diagnosis and steps to troubleshoot. I’ll keep banging around. Thank you again!
  8. Thank you, @wbmnfktr! I will read over the two links. As a test, I already created a new page and copied the content over to the new one by hand (not using the API), and the new one is having the same problem. I will check the links to see if I can make any sense of it.
  9. I was able to remove the "flagged" status by opening the page in ProcessWire and re-saving it. That didn't affect the "corrupted" status, though, and the page still does not show up in the navigation menu when viewing the problem page URL.
  10. AHA! I found a datum that sets the problem page apart. When I look at the TracyDebugger bd() output for the problem page (ie. bd(pages()->get('/problem-page'))), I see it has a property called "status". When I output this on any other page, the "status" property has the value of "flagged". But the same bd() outputs a value of "flagged, corrupted" when I view this output on the problem page URL. I still don't know how to fix it, but I'll post more here if I find anything. I still welcome any insight from those of you who recognize what may be going on! Thanks in advance!
  11. Here’s an unusual issue I’ve never seen before. I have a page called "Settings" that uses a page reference field to allow an administrator to construct and reorder pages for the main navigation menu. That field references 6 separate pages. The navigation menu template gets its PageArray() from the page reference field I just described, and prepends the site's homepage ('/'). That makes a total of 7 pages in the PageArray(). On just about every page of the site, I see all 7 pages in the navigation menu, no matter where I navigate. But on one particular page, only 6 pages
  12. Thank you for the perfectly comprehensible explanation! Not only does this solve the problem, but I see that it's a setting I can adjust form-by-form, in case I need something more complex in other contexts!
  13. Thank you, @netcarver and @DV-JF! So I go into this with my eyes open, what are the implications of turning off CSRF protection? Based on the description above, matching the submission with the session that saw the form may mitigate spam. Are there other perils I should know about that the default CSRF protection may defend against? Or is it an overzealous countermeasure when it comes to a simple contact form?
  14. Thank you, netcarver! I grepped my whole site directory for "sessionAllow" earlier and couldn't find anything. I just had a chance to dump $config into ready.php and here was some of the session-relevant output: <!-- ["sessionAllow"]=> object(Closure)#6 (1) { ["parameter"]=> array(1) { ["$session"]=> string(10) "<required>" } } ["sessionChallenge"]=> bool(true) ["sessionFingerprint"]=> int(1) ["sessionForceIP"]=> string(0) "" ["sessionCookieSecure"]=> int(1) ["sessionCookieDomain
  15. OOOOOOOHH! That makes sense. Yes, I am using a FormBuilder form on the site. Disabling cross-site scripting protection sounds bad, but I don't understand the relative risks or dangers. What are the trade-offs? If you disable XSS protection for the plugin, are there other reasonable countermeasures one can take?
  • Create New...