Jump to content

BraseTheGreat

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by BraseTheGreat

  1. Two years ago I have been working on two magazines. Both share a one instance of Processwire. I had to programme my own domain based queries. There are articles, categories, featured articles cotegory dependent (and time dependent) and also some scheduleable ads places. https://motormix.cz/ https://ceskeokruhy.cz/ Articles can be shown on both sites.
  2. Ok I did this: Long story short I used POST value stored from Form. $wire->addHookAfter('Pages::added(template=contact)', function(HookEvent $event) { $page = $event->arguments(0); ... if($_POST["idtestone"]){ $idtest = $page->zinzino_testids->getNew(); $idtest->zinzino_testid = $_POST["idtestone"]; $idtest->save(); $page->zinzino_testids->add($idtest); } $page->save(); }); Better approach?
  3. Hello, I have this problem: I have a FormBuilder form, where is text input. The form is set to be save as Page with specific template. The template has a repeater field MemberIds. In Form there is a text field CommaSeparatedMemberIds. So user fill for example 123,456.789. And I need to store this three numbers in template repeater field. And I have no clue how to do this. One option is to store the value to some "help field" and use hook Page:added where I explode the string and save one by one to repeater field. But I think there is a better way. Is'n it? Thank you for advice.
  4. Another clue: I looked to DB how the pages are saved: I thought that all data will be saved, but now I see that only IDs are present. Now it makes perfect sense, why there is data loss. Is there a way how to store all data from PageArray?
  5. Ok, maybe I am starting to understand. I replicated the problem here in much easier scenario: $home = $cache->get('home', 60, function() { $home = wire()->pages->get("/"); $home->custom_property = "Value"; return $home; }); bd($home); With these results (before and after cache): It seams that before save to cache, all object are transformed to some string/basic structure. Is there an option how to save to cache anything without any transformation regardless the type ob object?
  6. Hello community, I have a simple code: $fulldays = $cache->get('fulldays', 60, function() { $firstDayOfWeek = strtotime("monday -1 week"); $value = serviceGetFullDaysOld($firstDayOfWeek,21); // get full data from this monday for 21 days bd($value); //! First DUMP return $value; }); bd($cache->get('fulldays')); //! Second DUMP So two dumps in the code. Structure of dumped data is quite the same, but second dump (from cache) is missing data from attribute Activities: Am I missing something?
×
×
  • Create New...