Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by patman

  1. @update AG Thanks for the feedback, I'll have a look at that specific issues. <update>I just noticed I fixed at least the first issue, but I needed to cancel the PR as I have another issue</update> @gebeer I found out that modifying the DOM while iterating over it has issues. So it might not catch some of the relevant addresses. I'll need to modify the method again. 😞 Is it possible that you provide me the HTML source of the document you tried to use with the module for testing?
  2. I fixed the PHP 8 issues and also the problem mentioned in my previous post. See my pull request https://github.com/BlowbackDesign/EmailObfuscation/pull/15 for a solution. If someone has the opportunity please test and report back if there are issues. Actually, it should be a drop-in replacement. @Roope please consider my PR after testing.
  3. Hi @Roope, thanks for letting us know! I'm fixing some issues and would provide PRs as soon as I have found a working solution. Spoiler: the regex way of looking for addresses runs into a memory/performance issues on pages containing a lot of code.
  4. Hi! I ran into the issue that for longer pages the module did not work. After a lot of research I figured out that this is an issue with the regex and can be (fixed) using: /** * obfuscate email addresses at given (html) string * */ private function obfuscate($html) { ini_set('pcre.backtrack_limit',1250000); // FIXME! required for long documents on line 315. As one can read from https://stackoverflow.com/questions/4180910/php-preg-match-all-fails-on-long-strings, in general using regex for parsing HTML documents is a bad idea (as I understood). To me this therefore sounds like the module needs some rework to do the parsing in a different way in order to avoid memory issues. Did someone already do so? Otherwise I would work on it and do a PR.
  5. @chuckymendoza try commenting out line 247 and 248: /** * is_nan(NULL) is deprecated in PHP 8.1 and $key[64] is not initialized if(is_nan($c2)) { $e3 = $e4 = 64; var_dump($c2);} else if(is_nan($c3)) {$e4 = 64; var_dump($c3);} */ worked for me without an issue and I do not see the purpose of the code.
  6. Hey @Mike Rockett! I had a suspicion stemming from the behavior of the module, i.e. working but still triggering the err404 page. Line 152 of MarkupSitemap.module.php uses $this->addHookAfter althought you are trying to cancle further hooks in line 220/221. To me that means that first the err404 page is created and then replaced by the content of your module, but I think in case the path /sitemap.xml matches, your module should take control and everything else should only execute in case it is a different path (normal processing sequence). I just changed line 152 to "before" version like this: $this->addHookBefore('ProcessPageView::pageNotFound', $this, 'render'); Since then I didn't have any issues anymore and it seems to work as intended. Not sure this fully correct as I didn't read all the necessary documentation. Nevertheless, it solves my issue and didn't seem to have any (negative) side effect. Maybe with your know how you can confirm / comment / decline this solution? Best regards!
  7. Hi! Does anyone else have the following issue? I have the MarkupSitemap module install and it works but I still get my err404 page triggered. Anyone an idea why? I can call https://myserver.com/sitemap.xml and it renders I can also call it with http://. Still some search engines manage to trigger the error page. The log of $_SERVER["REQUEST_URI"] in such a case and shows "/sitemap.xml". How can that happen? Thanks!
  8. Yes, the sitemap is generated dynamically, there is no file that you can find, but of course you can call it. If you enable the stylesheet it is also quite readable. From my understanding of the source code I would say that in contrast to what the option "Include hidden or unpublished pages" suggests, only hidden pages will be included. The option is called sitemap_include_hidden and adds include=hidden to the selector.
  9. This is an issue when no cache exists. You can try to go to /site/modules/MarkupSitemap/MarkupSitemap.module.php and modify the start of the function (line 230) as follows: ... public function removeSitemapCache(): bool { // Cache settings $cacheKey = 'MarkupSitemap'; $cacheMethod = $this->cache_method ?: 'MarkupCache'; $removed = false; // by default nothing is removed // Attempt to fetch sitemap from cache ...
  10. I just had a quick look, I think there is a bug in the render function at the end: $this->page->inlineScript = $inlineScript; This would replace the page content always with the last map. Unfortunately, I was not quickly able to fix it. In my opinion adding a dot $this->page->inlineScript .= $inlineScript; should make it, but it didn't (at least in my quick try).
  11. Well the module says it uses this https://github.com/perliedman/leaflet-control-geocoder which itself says it can also do Google. Since I did not change anything in the logic you should be able to select a different provider and then it should do exactly what you would like it to do. Just one further step ahead ...
  12. Thanks for your feedback, I'll fix a few things Well, it is actually the purpose of this module not to use Google API. The description says So if you want to use Google you actually forked the wrong module maybe you should take a look at https://modules.processwire.com/modules/fieldtype-map-marker/ If you want the same modifications can for sure be also done there.
  13. I made my cleanup and pushed it to github: https://github.com/madebymats/FieldtypeLeafletMapMarker/compare/PW3...patman15:PW3 There is most probably still an issue with the default value, as I could not figure out how this works in the available time. Nevertheless, that has no real impact. I would be happy if some one could have a look and give feedback and/or test the version. I also added the new DB schema to allow for automatic updates. A smoke test went successfully. I'll wait for some feedback and make then the pull request.
  14. To give a status: I got it working I need to do some clean up and then I can provide it. @BrendonKoz Should I make a pull request to your code or to the original one?
  15. Ok, I'll give it a try on the weekend again. I really want to achieve correct address values so the users cannot mess-up text fields used for json+ld.
  16. @gmclelland Thanks I stumbled over it and had a quick look at it. Unfortunately, I decided to include my own php file that renders the schemata because I oversaw the customization options in that module. I'll switch at some later time, thanks!
  17. I did some deeper looks into the code, it seems that a few things are already prepared / were used previously: InputfieldLeafletMapMarker.js already contains a variable $addrJS that could store raw json. InputfieldLeafletMapMarker.module renders a hidden field _js_geocode_address that looks like intended for that purpose but it's coded wrong (id, no value). My thought is to use these variables to store the raw json and generate the currently used "address" out of them (by simple extraction of the name). Then I would store the raw value into the database field "data" so there is no need to update the scheme with an extra field "raw". Original field address can again be regenerated from the raw json anyway. I might have some time on the weekend to go deeper. Let me know if you have some more ideas/hints. I'd like to have the possibility to generate the json+ld for the website automatically.
  18. Sorry, should have given more details about my trials. I unfortunately have no experience with programming modules for processwire so I would need some more hints to fix it. The problem is that the value does not get stored into the database. (I tested it by putting a fixed string there.) The reason for this I suppose is that InputfieldLeafletMapMarker.module requires an input field in the __render function in order for processwire to store it, when the page is saved. My problem now was to get this field dynamically populated by the javascript part of the module, i.e. add appropriate code to InputfieldLeafletMapMarker.js. That's were I currently stand.
  19. Hi! @BrendonKoz I ran into the same issue that I would like to use the json data returned to populate json+ld structures. Did you ever find a solution? I played around with your code from github but couldn't fix it. Thanks!
  • Create New...