Jump to content

adrian

PW-Moderators
  • Posts

    11,204
  • Joined

  • Last visited

  • Days Won

    373

Everything posted by adrian

  1. @PWaddict - it might also be useful to see what these return. Some are repeats from before, but I would like to see all of these please. $filename = '"Test ä".png'; $pageFiles = new Pagefiles($page); d($pageFiles->cleanBasename($filename)); d($pageFiles->cleanBasename($filename, false, true, true)); d($sanitizer->filename($filename, Sanitizer::translate)); d($sanitizer->pageName($filename, Sanitizer::translate));
  2. Thanks @matjazp for testing that - much appreciated. It seems like everything is working as expected for you.
  3. I don't have access to a Windows machine dev environment at the moment. It might be related I suppose. I would have thought this issue would have come up before though because the cleanBasename method is what PW uses when uploading images, which is the reason I'd like to stay with this approach if I can, rather than the old pageName I was using before. In terms of how you could debug this, in that block of code I linked to, I'd want to know that mb_strpos, mb_eregi_replace and iconv calls are returning the same values on the Windows box that they are on linux. I would try this: if($beautify && $needsWork) { if($beautify === self::translate && $this->multibyteSupport) { $value = mb_strtolower($value); if(empty($replacements)) { $configData = $this->wire('modules')->getModuleConfigData('InputfieldPageName'); $replacements = empty($configData['replacements']) ? InputfieldPageName::$defaultReplacements : $configData['replacements']; } foreach($replacements as $from => $to) { if(mb_strpos($value, $from) !== false) { bd($from .' => ' . $to, $value); $value = mb_eregi_replace($from, $to, $value); bd($value); } } } if(function_exists("\\iconv")) { $v = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", $value); if($v) { bd($value, 'ICONV'); $value = $v; } } $needsWork = strlen(str_replace($allowed, '', $value)); } which should result in something like this which shows the replacement ä => a that is being made and with the final filename and whether the iconv call changes it further or not.
  4. Thanks, although not what I was hoping for ? I don't know how to debug this without being able to access your system. I am pretty sure it's in $sanitizer->nameFilter() which is called by many other methods. Have you manually edited the PageName character replacements? It seems that if I remove the needed ones from that and I disable iconv, then I can get the same result you are getting. Would you be up for trying to dig into that nameFilter method and see where it's failing for you? I think it's somewhere in this block: https://github.com/processwire/processwire/blob/a0570bb2a0919ddc38487f1adbb190f9f9ab90f2/wire/core/Sanitizer.php#L171-L186
  5. I don't think I have seen it before either, but on the site in question, it is triggered by the "Show Page IDs" option. If I turn that off, it works as expected.
  6. Sorry I didn't catch that ? So for some reason your install is behaving differently. I think I have narrowed it down to multibyte support or iconv. Could you please run these in the console and let me know what you get: d(function_exists("mb_internal_encoding")); d(function_exists("\\iconv"));
  7. @PWaddict - thanks for checking that code in the Console, but it looks the same as what I am seeing, so I can't figure out why you're getting a different result returned from the module. Not sure where to go from here other than asking you to test on another PW install.
  8. This is interesting: Are you seeing the first, rather than the second result? See the last commit where those booleans are passed to the cleanBasename() method: https://github.com/adrianbj/CustomUploadNames/commit/9428a18c4cf67a40c7ef6bd6b63ae600a28086e3 Could you please check that the version you are using has those lines and also please test that code in the Tracy console: $pageFiles = new Pagefiles($page); d($pageFiles->cleanBasename('"Test ä".png')); d($pageFiles->cleanBasename('"Test ä".png', false, true, true));
  9. Weird, that filename format patter for me returns: test_a_1545255464.jpg which should be exactly what we expect - correct?
  10. You can use: $input->post('reset-button') or $input->post->{'reset-button'} This is not a PW issue, but rather a PHP one - you just can't use hyphens like that. That is why PW field names use underscores and not hyphens.
  11. @PWaddict - I know you'd like me to just revert to that previous version but I would like to figure out why it seems to be working ok for me and not you. Can you please post your settings for the rename rule and an example of a field value that is causing htmlentities to be replaced with underscores.
  12. Go to Modules > Core > AdminThemeUiKit. You can choose the Gravatar option or you can edit the user template to add an images field which can be used for manually added images. Remember that the user template is a system template so you need to go to Setup > Templates > Filters > Show System Templates.
  13. Actually, I messed up that reversal, but I decided to investigate the issue you're having with 1.2.3 and I can't reproduce. This is what happens for me in a repeater - note that the ä is replaced with an "a" as expected. I don't think it should matter, but what version of PW are you running?
  14. Thanks for noticing that - I have reverted that change and bumped the version number to 1.2.4 to make sure anyone who upgraded to 1.2.3 sees that there has been an update.
  15. @PWaddict - I just committed another update which makes use of PW's core cleanBasename method for generating the final filename. I think this should be an improvement in certain situations. Please let me know if you have any problems with it.
  16. Yep, good catch - please try the latest version.
  17. Hey @tpr - I've started seeing something weird in the page tree with hidden pages. They don't show until I mouse over the tree itself: Let me know if you can't reproduce and I'll try to narrow it down for you.
  18. You can also switch PW versions instantly with Tracy. By default it works with versions which are archived by Ryan's PW Upgrades module, but there should be nothing stopping you from recreating those archived version manually by creating .wire-x.x.x folders with the contents of that version's wire folder.
  19. No problem! BTW, I have updated the module so it is now tagged as requiring php 5.4 so hopefully no-one else comes across this error.
  20. Well if you upgrade you won't need to change anything. But in the meantime look at line 106 (where that error is coming from) and you'll see $this->wire('languages') - change that to wire('languages'). Do the same for other instances like $this->wire('session') - change this to wire('session'). Does that make sense?
  21. That's because Tracy requires PHP 5.4. 'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4', This is a requirement of the Tracy core and not specifically my module. Please note that PHP 5.4 has been out for 6 years now. 7 has been out for 3 years. If your host won't let you upgrade to 7 I would look elsewhere!
  22. PHP 5.3 is the issue - it doesn't let you use $this in anonymous functions. I had forgotten about this as I haven't used 5.3 in years. The quick fix for you is to change those instances of "$this->wire" to just "wire" I think probably many of my modules will be affected by this ?
  23. While I am waiting to hear back, if you have a critical error like this, you can remove a module by deleting it's files from /site/modules and it's entry in the modules database table which is easy to do with Adminer which is packaged with Tracy.
  24. Hi @Tobi - sorry you're having problems. What version of PW, this module, and PHP are you running?
  25. __() works for me in a config.php file here: https://github.com/adrianbj/CookieManagementBanner/blob/master/CookieManagementBanner.config.php I know that's not very helpful though ? Perhaps it's a namespace issue - are you declaring the ProcessWire namespace, or have you turned off the file compiler (which is needed if you don't declare it).
×
×
  • Create New...