Jump to content

kixe

Members
  • Posts

    803
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by kixe

  1. Not really. With a little testing (without errors). Obviously not enough! Didn't check the usage inside repeater.
  2. @Rajiv I was very busy with other stuff today. Now I had a little time to check the module within Repeater (you didn't mention the usage inside a repeater). I couldn't reproduce your error exactly, but I fixed some other (maybe related) stuff. I pushed an update 1.0.4. Please try out and tell me if the error still exist. Which PW Version do you have in use?
  3. @Rajiv Thanks for reporting. I pushed an update. Please checkout and tell me if it is working now. I couldn't test.
  4. Problem still exists. What i did until now: I modified the core function WireFileTools::mkdir() to get more detailed information about what is going on. Error occurs because PHP::mkdir() is not able to create the directory and returns false. I deleted the page cache completely to let ProcessWire recreate the cache. After a few days most of the cachefiles are recreated as normal, some cache files are overwritten/ updated. But still in some cases PHP::mkdir() is not able to create the directory and return false. I added a sleep(2) after the first fail to try again after 2 seconds with same result. Maybe not a race condition then. I cannot see any issues on parent directories. @LostKobrakai Could you specify which kind of issues on one/some of the parent directories could cause this problems? About CacheFile class: I think if the CacheFile constructor fails, the output of the page shouldn't stop. Better solution would be logging an error and output the uncached page. Any help appreciated!
  5. @LostKobrakai I am not sure if I explained my problem well. I will try again. The fact that the directory cannot be created results in the error I mentioned above. It is always the first time the system tries to create the directory. Since CacheFile constructor throws an Exception after WireFileTools::mkdir() returns false, the page visitor (guest user) will get a notice instead of an uncached site: Unable to complete this request due to an error. - Error has been logged. Administrator has been notified. This is inacceptable for a site in production mode. If a directory is created once it will not be deleted later, except manually. There is no problem to save or replace the cachefiles in the folder. Only chance to go around this is to disable caching.
  6. @bernhard CronjobDatabaseBackup and ProcessDatabaseBackups are siblings. I put them a little closer together.
  7. @LostKobrakai The template cache interval is one week for the related pages but the problem is not the creation/ recreation of the cache file. This works as expected. Only the creation of the page related directory doesn't work sometimes. I have some similar configurations on other hosts without problems like this. I am in touch with the support, but still no idea.
  8. The error occurs always at the same minute (22). Once or twice a day. No cronjobs running hourly. Cannot figure out what the problem is.
  9. This could be a starting point. I used a customized version for a private car sharing site.
  10. @Krlos @Karl_T I fixed the single/ multilanguage issue. Sorry for the delay ... Please update to 2.0.1 and try out.
  11. From time to time I receive an error notice from a live site I made. Page: http://example.org/en/media/live-recording/ User: guest Error: Exception: Unable to create path: […]/site/assets/cache/Page/2040/ (in […]/wire/core/CacheFile.php line 62) This doesn't happen if I call the page from my computer, with any browser, even if I am not loggedin (guest). In each case the path will be created. Why is the system unable to create the cache path in some cases? Any experiences?
  12. Perhaps this new config field could be a Selector field ... //in MarkupCookieConsentConfig array( 'type' => 'Selector', 'name' => 'pageSelector', 'label' => __('Banner display limit'), 'description' => __('Define selectors, which limits the display of the banner to selected pages.'), 'columnWidth' => 100 ) // in function renderCookieForm() // we stop here when on admin pages except this modules config page (for demonstration) or out of pageSelector if(($page->template != 'admin' && wire('pages')->find($this->pageSelector)->has($page) == false) || ($page->template == 'admin' && $this->wire('input')->get->name != $this)) return;
  13. @Can Sorry if I didn't speak clearly. I was talking about the banner, not the cookie itself. I don't need an option to modify the path of the consent cookie itself, so I would hardcode it to '/'. (To stay complete leave it as is.) Much more interesting is to limit the display of the banner to a selectable page tree. Therefore an additional pagefield in the config could be useful. Lets call it pageTree. You just need to add one line at the beginning of the renderCookieForm() function. if($page->id != $this->pageTree && $page->parents->has(wire('pages')->get($this->pageTree)) == false) return; An additional checkbox to include or exclude the parent page would complete this option.
  14. ProcessWire Image description field has no limits by default.
  15. Again me. Forget about what I have written before. You could use 'Newlines to XHTML Line Breaks ', if you set the Number of rows for the description field to minimum 2 under the Input tab.
  16. Under the Details tab in the Image field settings you could add textformatters to the description field. You could use 'Newlines to XHTML Line Breaks '. (Edit: Inputfield doesn't accept newlines) You could use Ryans Textformatter Hanna Code and create your own replacements. http://modules.processwire.com/modules/process-hanna-code/ or more simple: <?php /** * ProcessWire 'slashN2br' Textformatter * @author Christoph Thelen (kixe) * * ProcessWire 3.x, Copyright 2016 by Ryan Cramer * https://processwire.com * */ class slashN2br extends Textformatter { public static function getModuleInfo() { return array( 'title' => "string '\\n' to <br/>", 'version' => 100, 'author' => 'kixe', 'summary' => "Converts the string '\\n' to XHTML line break <br /> tags. Useful in image description fields", ); } public function format(&$str) { $str = str_replace(array('\n'), '<br/>', $str); } } Save the code under /site/modules/slashN2br.module Not tested.
  17. @LostKobrakai Thanks for the reply. I know I could use magic methods like __call(), __set() and __get(). But what can I do if some of the properties in the bar class are protected? How can I set or get them via module, if the module isn't a child class of 'Bar'?
  18. I have a custom module running under PW 2.7. The module class extends a third party class out of the PW scope. I want to make an update to 3.0 or 2.8. Unfortunately I cannot get it working. Example: Foo.module <?php require_once('bar.php'); class Foo extends Bar implements Module { public static function getModuleInfo() { return array( 'title' => 'Foo', 'summary' => 'Extending non PW Class' ); } } bar.php <?php class Bar { public function aboutme() { return 'I am Bar. Parent class of Foo.'; } } template.php <?php $foo = $modules->get('Foo'); var_dump($foo->aboutme()); I get the following results No problems to install/ uninstall under PW 2.7. The return in frontend is as expected: string 'I am Bar. Parent class of Foo.' (length=30) Under PW 3.0 I get the following error: Error: Class Foo contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (ProcessWire\Module::className) I made the following update in Foo.module <?php require_once('bar.php'); class Foo extends Bar implements Module { public static function getModuleInfo() { return array( 'title' => 'Foo', 'summary' => 'Extending non PW Class' ); } public function className($options = null) { return get_class($this); } } Now trying to install the module I get: Session: Failed to construct module: \Foo - Wire::wire($o) expected WireFuelable for $o and was given Foo and in frontend: Fatal error: Call to a member function aboutme() on null Why isn't it possible anymore to extend a class which is not an instance of Wire or WireFuelable? How could I get this working again? Any suggestions welcome!
  19. You need to create a function which hooks in LanguageTranslator::getTranslation() to manipulate the result.
  20. I made an update 4 month ago to solve this. Unfortunately it hasn't been changed on github, but it is marked as changed in my desktop tool. Don't know why. Anyway I will make an update today. I have the module running under 3.0.39 without problems. Please update to 1.2.1
  21. @cjx2240 Welcome to the forums. The Module pulls selectable Inputfields from InputfieldPage module. Go to the module settings of InputfieldPage and add the Inputfieldtypes you want to have available in Fieldtype SelectExtOption.
  22. To get access to any other database table within ProcessWire you could use my module Fieldtype SelectExtOption http://modules.processwire.com/modules/fieldtype-select-ext-option/
  23. As Robin S recognized in your comment you are talking about OR, but your code is doing something else. This one should be able to replace your code (not tested) $all = $pages->find("template=player, team.name=$selectedTeam"); $selector = "(people.count>=3), (places.count>=3),(people.count>=2, places.count>=1),(people.count>=1, places.count>=2)"; $allConcerned = $all->filter($selector); $notConcerned = $all->not($selector); As far as I know there is no diff function like array_diff for WireArrays.
×
×
  • Create New...