Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by adrian

  1. @bernhard - I like you're thinking here. Surely it would be a simply matter of extending Tracy's TD class (https://github.com/adrianbj/TracyDebugger/blob/master/includes/TD.php) with the required new dumping methods.
  2. I actually found that quite buggy still and IIRC it doesn't handle RTE embedded images (ie it doesn't rewrite their paths to the new location) like Migrator does. Not saying Migrator is perfect by any means, but the core page export/import was pretty broken in my experience.
  3. Check the import settings where is says "APPEND will not change settings of existing fields, nor the content of existing pages."
  4. Hey @bernhard - thanks for all the details. I'll have to get back to you on most of them, but I can explain the reason for the quirky stuff in your module. It is due to the really old version of ACE included with the InputfieldAceExtended module that you are making use of. The same thing happens with Ryan's HannaCode module - there is an issue posted about that here: https://github.com/ryancramerdesign/ProcessHannaCode/issues/21
  5. @Peter Falkenberg Brown - sorry, I don't understand why you are trying to reinvent the wheel here - there are a LOT of problems to solve and Migrator works for this already.
  6. I have thought about making it a separate Process module so it can be opened on it's own page in the PW admin, but I am not sure about making it modifiable - what would you need to modify for you needs? Based on your tabulator example, it sounds like you are talking about extending the output options? But how best to do that? Is it just a matter of being able to inject (in the background) some additional JS to process the code and format as a table? I am happy to talk about this more, but I haven't enough time at the moment to do anything substantial on this unfortunately. If you could think through how it should work in some more detail, that might make make it easier for me to implement. Of course PRs are also welcome, but I am happy to help implement if you figure out a plan for how it should work.
  7. @Peter Falkenberg Brown - I still use https://github.com/adrianbj/ProcessMigrator for things like this - it works a treat with images (including updating paths to RTE embedded images). It's not regularly maintained and some users have had issues over the years but I still find it much more reliable than the PW core export/import tools.
  8. Much appreciated - I'll admit to not knowing too much about these options yet, so great to get some more knowledgeable input. Thanks!
  9. Thanks @MoritzLost for figuring that out. I have added a check to prevent that error when a module doesn't extend WireData. Honestly, I think the getting of module settings in PW is a bit of a mess which is why I use 3 different approaches in Tracy because they all return different things for some modules. Let me know if you have any problems with the new version. Thanks @rick for the heads up on that. I took a quick look, but I don't have time to fix things at the moment - I set a lot of cookies in various places in Tracy and I am not using a standard method so it's not easy to change them all and I sometimes set in JS and sometimes in PHP. Obviously I don't want to make them "secure" because I am sure many of us are running local dev setups without https, so I probably need to just set the sameSite rule to Lax, but maybe Strict is better? Not sure yet, but it's on my list to take care of soon.
  10. Just a heads up that might hopefully help save someone some time. Browser adblockers don't like "google-analytics" in ajax calls these days which breaks all the ajax calls in this module. I changed the name (not title) of the Admin > Google Analytics page in the PW admin and also changed the PAGE_NAME constant on this line: https://github.com/wanze/ProcessGoogleAnalytics/blob/c97c170485ff91f81d8a67e72b968a1c8e25165e/ProcessGoogleAnalytics.module#L25 In my case I changed them both to "stats" because I didn't want to mess around figuring out whether it was "google" or "analytics" that was causing the problem, but other names should also work.
  11. @MoritzLost - from my initial investigation, it looks like a PW core bug. You are using this (https://processwire.com/blog/posts/new-module-configuration-options/#enter-the-new-moduleconfig-class) approach to defining module settings which I have never used, but it appears that when that approach is used, the getArray() method doesn't exist on the module, hence the error. Do you know of another module that uses that approach that I could test to confirm?
  12. Not really answering your question, but I think these days, this module (http://modules.processwire.com/modules/search-engine/) by @teppo might be a better approach to what you're trying to achieve.
  13. Something like this should get you going. This is stolen from a recent import I did which worked well. This assumes you have a field called "images" that you want the images uploaded to. I have also done more complex versions of this when the source HTML image tags have width and height tags - you can use those to resize the images using the PW API and embed that version back into the HTML. $dom = new \DOMDocument(); @$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); foreach($dom->getElementsByTagName('img') as $img) { // grab image from the external URL and add to images field try { $np->images->add('http://olddomain.com/' . $img->getAttribute('src')); if($img->getAttribute('alt') != '') { $np->images->last()->description = $img->getAttribute('alt'); } $img->setAttribute('src', $np->images->last()->url()); } catch(\Exception $e) { // in case remote image can't be downloaded } } return preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>', '<p>&amp;n<p>', '<p><p>', '</p></p>'), array('', '', '', '', '<p>', '<p>', '</p>'), $dom->saveHTML()));
  14. What about Tracy's PW Info panel - finds the page and provides edit, view, and open links. Maybe you want for site editors, in which case this obviously isn't very useful, but I use this many times a day during development.
  15. Surely you'll also want to find all images and automatically upload them to the assets/files/xxxx for the new page and then rewrite the img src to the new path. Maybe also grab the alt tag and add that to the description field in PW. Personally I would go with DOMDocument over a regex for this, but both would work.
  16. Is a new AJAX bar showing at all (even without a Dumps panel entry). If it's not, then it's probably an issue with Nette forms not sending the 'X-Requested-With': 'XMLHttpRequest' Or maybe it's related to that - if it's an AJAX form submission and then you do a redirect afterwards, that a) seems to defeat the reason for an ajax submission, and b) is probably why the AJAX bar is lost. Does it show in the ajax bar if you don't do the redirect? Not sure about that - I'll look a little later and after I hear back about those possible reasons for #1
  17. Sorry, I have no idea cause that should result in the same thing. If you do feel like debugging, you'll see that the way I handle renaming when the settings is hidden is to move the name field to the Content tab and then hide it (https://github.com/adrianbj/PageRenameOptions/blob/8665aca5023417163841603fda8037df2ccbe245/PageRenameOptions.module#L95-L98) You could check to see that the field is correctly being placed there and that it is changing when the title is changed. The easiest way to do that is to use the browser dev console with this after you've changed the title. $('#Inputfield__pw_page_name').val(); If not, then at this point I'll need to hear from someone else.
  18. Via the System tab setting, or are you applying via a hook or something? Fair enough 🙂 - if anyone else is having issues with this not working, please let me know.
  19. Hey @bernhard - it works for me. How are you disabling the settings tab?
  20. Perhaps @Robin S's similar module (https://github.com/Toutouwai/FieldtypeRuntimeOnly) might work?
  21. That dev version number is automatically updated from Github (AFAIK) but not sure how often it is called. It is showing 3.0.155 as of right now. Regardless it will always download the latest dev version.
  22. If you work with deeply nested / large JSON data and you use Adminer, the latest update will allow you to speed things up significantly with a few new config options. I've also included a PR to the JSON preview plugin which this functionality relies on - my changes ensure the max text length setting is applied to json that is kept as a string due to the max level setting.
  23. @toni - the docs show (https://processwire.com/api/ref/page/references/) that you can use a selector exactly as you are describing. Did you try to see if it works as you want?
  24. In reality, that getImageInfoSVG() method should probably try to get the dimensions from the viewbox attribute in the SVG (if actual width and height attributes are not available), before it resorts to using imagick to get them. That would remove the need to rasterize just to get the dimensions.
  25. Sorry, I thought you were calling a "good host" a luxury. Anyway, I am sure there are no ill feelings - sorry if I over-analyzed things 🙂
  • Create New...