Jump to content

netcarver

PW-Moderators
  • Posts

    2,233
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by netcarver

  1. Not too helpful, but download and install of that module is working fine for me on a linux box. PW3.0.36 installed.
  2. @tpr Appending the confirm sounds like it could work - just need to get it out from under the mouse pointer to stop inadvertent second clicks. If you can replace the initiating link with a cancel button that would be even better as an inadvertent second click would leave things nice and safe. @adrian Batch Child Editor would need it's own terminology brought into line with that.
  3. @tpr Could you make it so the confirm link does not appear in the same location as the initiating link - I'm just worried about some users I know who click twice in the same place; they'll end up inadvertently wiping pages if the confirmation link isn't offset from their last click position. There's a demo Pen here, (it was based on one of LostKobrakai's pens - can't find the link now) that shows what I mean.
  4. @backes In case you missed it, there seems to be an issue with Download guard - it's discussed briefly in this forum thread.
  5. If you use a string for your module version parameter, you can have more than the three fields. For example... ...and the code... Not sure if this plays well with version checking - but it is possible.
  6. @easynowbabyIt might be advantageous for you to post about this in the padloper support forum as Antti is more likely to see it and fix it if it's in there.
  7. @pleini I might be barking up the wrong tree, but looking at the message, it seems like it is looking for a class in the root namespace (class \FieldtypeZZFile) and I'm not sure this is correct for the file compiler, I would have expected it to be looking for a class called \Processwire\FieldtypeZZFile. Might be worth raising this as an issue in the new issues repository on github (post again if you need a link there.)
  8. @tpr I tried this module out when it was a very little baby and ended up removing it as there were too many layout quirks when used with the Reno theme (which I use by default.) I re-installed it yesterday to find that it's grown up very nicely! It's now in three installs and probably heading for more. Thank you for this module! I'm also about to try out your MarkupSrcset module - but that's off topic here.
  9. Forgot to mention: unless I hear otherwise from ESRCH (I've messaged) I plan on pushing this to the module repository as it's so useful, it needs to be in there from someone. Anyone.
  10. I've created a git repository for this useful little module here. Fully attributed (in the module) to ESRCH.
  11. @horst A quick question on a related note, does EXIF data get stripped from variations when they are produced? I guess this might depend on the method used (CroppableImage3 etc)
  12. Could you try... $hp = $event->pages->get(1);
  13. @Zeka @tkaranka If this needs fixing in the codebase, could one of you raise an issue for it in either the new ProcessWire issues repository or the requests repository.
  14. @David Beesley One approach I've used before when importing thousands of records that need to be made into pages, is to stash the data from the external API into a work queue (php-resque or one of the WireQueue implementations) and have cron-initiated workers regularly batch-process a certain number of queue entries, creating pages for them, before exiting. I've done this for a client in the past and it works very well.
  15. @David Beesley Not sure if this will help, but if you are creating pages using some variable, say $p, inside a loop - try telling $pages to un-cache $p at the end of the loop; $pages->uncache($p); Or omit the $p argument to clear all cached pages.
  16. If anyone is interested, I just pushed a couple of updates to my fork of Nik's excellent module. This version adds logging of selector string and the result summary - something I was missing as I'd kind of play with the string, hit a selector that worked for me and promptly loose it by fiddling some more with it. You need to look in the log (or use the log viewer) to find the previous strings - but at least they are there. Additionally, the forked version adds a hook to allow custom titles to be generated for repeater fields (Shown below with custom titles for the relationships repeater) The code to produce the custom label being... /** * Custom hook to format repeater field labels in ProcessSelectorTest results... * * Turns labels from ... to => ... this * * '0' => '0 Parent of: Jack, Jane, Jill' * '1' => '1 Coach of: Anne, Benjamin, Connie, Dick, Emily, Faith, Gill' * '2' => '2 Spouse of: Richard' */ $pages->addHookAfter('ProcessSelectorTest::formatRepeaterLabel', function($event) { $replabel = $event->return; $parent_field = $event->arguments(0); $repeater = $event->arguments(1); if ('relationships' == $parent_field->name) { if ($repeater->people) { $replabel .= ': ' . $repeater->people->implode(', ', 'title'); } } $event->return = $replabel; }); I'll issue a pull request to Nik - but he's not been particularly active here recently.
  17. @ZGD The above way of encoding/decoding is only meant as an example - it will put carriage-returns and linefeeds anywhere there is a literal '\r' or '\n' in the data. So, if you have anything like a Windows path (C:\regarding\my\new\nested\filesystem) you could get C: egarding\my ew ested\filesystem out. You will need to pick substitution tokens (particularly for the "\n" newlines) that will not be in your data stream. I think you will get away without substituting the "\r" carriage returns.
  18. I had a similar problem to this when I wrote a module for a client. It turned out that having a tab open on the module's log page stopped the hook from firing, even though I had a cron job, running every minute, visiting a page on the site. As far as I can tell, the auto refresh that occurs on the log pages somehow stops the hook from triggering. Once I closed the log view page, I could watch things go back to normal just be looking at the actual log file from the command line using the 'tail -f' command. The solution for me was to only open the log pages when needed and provide my own view of the log tail as part of the module's settings page. HTH
  19. I don't think so, no. The idea above was to replace any embedded ASCII carriage-return+linefeed pairs with a literal sequence '\' + 'r' + '\' + 'n' on save of the data. On reading the data the, now-literal, sequence is turned back into an embedded ASCII pair. If the ASCII linefeed and return characters can occur anywhere - not just next to each other - then you need to replace them individually. Try doing this instead... protected function encodeData($data) { $data = serialize($data); $data = str_replace("\r", '\r', $data); $data = str_replace("\n", '\n', $data); return $data; } protected function decodeData($data) { $data = str_replace('\r', "\r", $data); $data = str_replace('\n', "\n", $data); $data = unserialize($data); return $data; } public function addItem($arrayData) { if(!$this->_addItem()) return false; if(2 != $this->getState()) return false; if(!$fp = @fopen($this->getFilename(), 'ab')) return false; if(flock($fp, LOCK_EX)) { $data = $this->encodeData($arrayData) . "\n"; $res = fwrite($fp, $data); fflush($fp); flock($fp, LOCK_UN); fclose($fp); return $res == strlen($data); } fclose($fp); return false; } public function getItem($worker = null) { if(!$this->_getItem()) return false; if(2 != $this->getState()) return false; if(!$fp = @fopen($this->getFilename(), 'rb+')) return false; if(flock($fp, LOCK_EX)) { $line = trim(fgets($fp)); if(!$line) { flock($fp, LOCK_UN); fclose($fp); if(0 == $this->itemCount()) return null; return false; } // we have the first entry, now write all following data into a buffer $fpTmp = @fopen('php://temp/maxmemory:' . intval(1024 * 1024 * 5), 'rb+'); while(!feof($fp)) fwrite($fpTmp, fread($fp, 4096)); fseek($fp, 0, SEEK_SET); ftruncate($fp, 0); fseek($fpTmp, 0, SEEK_SET); // write back buffer into file while(!feof($fpTmp)) fwrite($fp, fread($fpTmp, 4096)); fclose($fpTmp); fflush($fp); flock($fp, LOCK_UN); fclose($fp); } return $this->decodeData($line); } Sorry, I don't really have time to test this out - you'll have to play with the encoding. You may find that doing the serialisation at the end of the encode (and unserialisation at the start of decode) might do it. HTH
  20. I have a load of sanitised values containing '-' characters that I successfully use in selectors; I'm working with one at the moment. It's disallowed from sanitised field names though - as they get translated to PHP variable names and have to follow the same rules.
  21. The module would require write access to the .htaccess file - if I'm understanding its operation correctly.
  22. @Macrura @horst I've added this feature request to the new repo - please emoti-vote for it if you still want this as a core feature. As a side note, here are some screenshots of a module that I ended up developing in the absence of this feature. Take a standard ASM Select... ...add some extended data attributes to the options... ...and a little javascript to use the data-group attribute of the selected options to disable other, currently unselected options with a matching data-group value (all while keeping things in the right sort order.) You then get a list that prevents your gymnasts from being booked in to the Trampoline group at the same time they are already booked in the Gymnastics group...
  23. Just spent an hour or so learning how to set-up custom scheme handlers in Arch linux to try this feature out and it's now working fine for me after a few false leads. This will really come in handy - thanks Adrian and the Tracy devs!
  24. As promised, here's the script with delete powers. Only tested on a small subset of an installation I'm switching over to CroppableImage3 so do your own testing please!
  25. I think that's a reasonable position to take - it addresses the concern expressed by @szabesz here, and can still be used to provide folks like @Sephiroth access as described here.
×
×
  • Create New...