Jump to content

noodles

Members
  • Posts

    25
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Münster, Germany

Recent Profile Visitors

2,229 profile views

noodles's Achievements

Jr. Member

Jr. Member (3/6)

10

Reputation

  1. I tested it. Works great. Thank you very much! I merged it with my adjustments. Maybe you’d like to take another look at it sometime. But for now, I think I’ve bothered you enough. 😄 RRule "byhour" extension Problems with multilanguage websites and PagePaths module: I am happy to provide my dirty code, if you'd like so. 😉
  2. Of course it is! 🙂 Let's focus on appointments rather than events. In my case, I create a series of appointments: every weekday from 10 AM to 7 PM, every hour, until June 30th. People can book an appointment in my online calendar. Once booked, the appointment needs to be marked as "booked" so my client and his clients can see that it is no longer available. My initial idea was to add a checkbox field to the appointment template. This checkbox would be automatically checked when an appointment is booked. If an appointment gets canceled, my client could manually uncheck it, making the slot available for booking again. However, I realized that this approach conflicts with the concept of recurring appointments since they are inherently identical. That said, I forgot to update my post yesterday! 🙂 Here's what I ended up doing: Instead of modifying recurring appointments directly, I took a more straightforward and compatible approach. When an appointment from the series is booked, I delete that specific instance and create a new single appointment via the API. This way, my client can still modify the checkbox if needed, and the appointment time is kind of "extracted" from the recurring series. I think that's way cleaner than my previous idea.
  3. Super, thanks a lot for your reply and for your work on the module. Our project is almost finished – extremely fast, thanks to RockCalendar! 🙂 But I still have one use case where I’m currently working around a limitation. In the hookRecurringEventEdit method, all fields are removed for recurring events. However, my client is using a booking calendar where events shouldn't be permanently deleted, as they may need to be made available again later. Right now, I could simply delete an individual event from the recurring series when it's booked, but that would mean my client would have to manually create a new event if it needs to be released again. A more convenient solution would be to allow them to just make the event available again. So, I added a checkbox to the template that gets set when an event is booked. The event is then no longer offered in the frontend and is displayed in a different color in the backend. However, it would be really awesome if my client could simply uncheck the box to make the event available again. But currently, that’s not possible. 🙂 What was your reasoning behind removing all fields from recurring events instead of just the title field? I'm curious. 🙂 For now, I’ve made a quick and dirty modification in your module to allow only the RockCalendar field and my additional field, but I’m very interested to know if I’m overlooking something. Edit: Okay, I probably know why. My field won't save. 😄
  4. Hey @bernhard! First of all: Enjoy the rest of your vacation! 😉 And thank your for your reply! Yes, I am! It's done with the "byhour" property, like this, which obviously is way nicer than any dirty workaround approach. new RRule({ freq: RRule.MINUTELY, dtstart: new Date(Date.UTC(2025, 2, 5, 10, 0, 0)), count: 30, interval: 75, byhour: [10, 11, 12, 13, 14, 15, 16, 17, 18] }) Let me know if I can help in any other way. I'm in Vienna in April. Coffee's on me. 😉
  5. I was able to temporarily fix the problem by moving $this->addSseEndpoints(); from init() to ready(). After that, everything worked immediately. It now looks like this: public function init() { wire()->addHookAfter('/rockcalendar/events/', $this, 'eventsJSON'); wire()->addHookAfter('/rockcalendar/eventDrop/', $this, 'eventDrop'); wire()->addHookAfter('/rockcalendar/eventResize/', $this, 'eventResize'); wire()->addHookAfter('Page::loaded', $this, 'inheritFieldValues'); wire()->addHookAfter('ProcessPageEdit::buildFormContent', $this, 'hookRecurringEventEdit'); wire()->addHookProperty('Page::isRecurringEvent', $this, 'isRecurringEvent'); wire()->addHookAfter('ProcessPageEdit::buildFormDelete', $this, 'addTrashOptions'); wire()->addHookAfter('ProcessPageEdit::buildForm', $this, 'openDeleteTab'); wire()->addHookAfter('Pages::trashed', $this, 'hookTrashed'); wire()->addHookAfter('ProcessPageList::execute', $this, 'autoCloseModal'); } public function ready(): void { $locale = $this->getUserLocale(); if ($locale) { wire()->config->js('RcLocale', $locale); } wire()->config->js('RockCalendar', self::translations()); $this->addSseEndpoints(); } It works fine like this. Am I in for another surprise now? 🙂
  6. Hi! We just purchased this fantastic module. The feature set looks great and almost completely covers our use case. However, I have a problem and a question. 😉 Problem When I try to create recurring events, I see an issue in the Chrome console related to Page::localPath. Our website runs on ProcessWire 3.0.229 and is multilingual. I can see that the first call to /create-recurring-events/ correctly transmits the information for the events to be created: { "pid": 2049, "diff": 0, "title": "Test", "rows": [ { "id": 1, "date": "2025-03-04 12:00:00", "done": 1 }, { "id": 2, "date": "2025-03-05 12:00:00", "done": 0 }, { "id": 3, "date": "2025-03-06 12:00:00", "done": 0 } ] } However, all subsequent AJAX calls return this error: data: {"current":1,"progress":0.33} Fatal error: Exception: Method Page::localPath does not exist or is not callable in this context (in /path/to/project/wire/core/Wire.php line 563) #0 /path/to/project/wire/core/Page.php(1512): ProcessWire\Wire->___callUnknown('localPath', Array) #1 /path/to/project/wire/core/Wire.php(419): ProcessWire\Page->___callUnknown('localPath', Array) #2 /path/to/project/wire/core/WireHooks.php(968): ProcessWire\Wire->_callMethod('___callUnknown', Array) #3 /path/to/project/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'callUnknown', Array) #4 /path/to/project/wire/core/Wire.php(487): ProcessWire\Wire->__call('callUnknown', Array) #5 /path/to/project/wire/modules/PagePaths.module(451): ProcessWire\Wire->__call('localPath', Array) #6 /path/to/project/wire/modules/PagePaths.module(82): ProcessWire\PagePaths->updatePagePaths(Object(ProcessWire\Page)) #7 /path/to/project/wire/core/WireHooks.php(1094): ProcessWire\PagePaths->hookPageMoved(Object(ProcessWire\HookEvent)) #8 /path/to/project/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'added', Array) #9 /path/to/project/wire/core/PagesEditor.php(787): ProcessWire\Wire->__call('added', Array) #10 /path/to/project/wire/core/PagesEditor.php(478): ProcessWire\PagesEditor->savePageFinish(Object(ProcessWire\Page), true, Array) #11 /path/to/project/wire/core/Pages.php(840): ProcessWire\PagesEditor->save(Object(ProcessWire\Page), Array) #12 /path/to/project/wire/core/Wire.php(416): ProcessWire\Pages->___save(Object(ProcessWire\Page)) #13 /path/to/project/wire/core/WireHooks.php(968): ProcessWire\Wire->_callMethod('___save', Array) #14 /path/to/project/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'save', Array) #15 /path/to/project/wire/core/PagesEditor.php(117): ProcessWire\Wire->__call('save', Array) #16 /path/to/project/wire/core/Pages.php(975): ProcessWire\PagesEditor->add(Object(ProcessWire\Template), Object(ProcessWire\Page), '67c6c56091a46', Array) #17 /path/to/project/wire/core/Wire.php(416): ProcessWire\Pages->___new(Array) #18 /path/to/project/wire/core/WireHooks.php(968): ProcessWire\Wire->_callMethod('___new', Array) #19 /path/to/project/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'new', Array) #20 /path/to/project/site/modules/RockCalendar/RockCalendar.module.php(71): ProcessWire\Wire->__call('new', Array) #21 /path/to/project/site/modules/RockGrid/RockGrid.module.php(502): ProcessWire\RockCalendar->ProcessWire\{closure}(Object(stdClass), Object(stdClass)) #22 /path/to/project/site/modules/RockGrid/RockGrid.module.php(116): ProcessWire\RockGrid->sseEndpointStream(Object(Closure), Object(Closure)) #23 /path/to/project/wire/core/WireHooks.php(1085): ProcessWire\RockGrid->ProcessWire\{closure}(Object(ProcessWire\HookEvent)) #24 /path/to/project/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'pathHooks', Array) #25 /path/to/project/wire/modules/Process/ProcessPageView.module(265): ProcessWire\Wire->__call('pathHooks', Array) #26 /path/to/project/wire/modules/Process/ProcessPageView.module(116): ProcessWire\ProcessPageView->renderNoPage(Object(ProcessWire\PagesRequest)) #27 /path/to/project/wire/core/Wire.php(416): ProcessWire\ProcessPageView->___execute(true) #28 /path/to/project/wire/core/WireHooks.php(968): ProcessWire\Wire->_callMethod('___execute', Array) #29 /path/to/project/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #30 /path/to/project/index.php(67): ProcessWire\Wire->__call('execute', Array) #31 /path/to/server/vendor/laravel/valet/server.php(234): require('/path/to/project/index.php') #32 {main} in /path/to/project/index.php on line 76 Warning: Cannot modify header information - headers already sent by (output started at /path/to/project/site/modules/RockGrid/RockGrid.module.php:455) in /path/to/project/wire/core/WireHttp.php on line 1823 This is going endlessly then and a lot of "broken" events are created. 🙂 And my question Would it be possible to consider opening hours when creating recurring events? For example, I want to create appointments every 75 minutes between 10 AM and 5 PM for the next 6 weeks. Do you have an idea for this? If necessary, I could take a "dirty" approach and delete the unwanted appointments afterward. 😉 Thanks in advance, Niko
  7. Anyone any clue? I still have no idea how to achieve this. ?
  8. Hey there, I need to populate and save the custom fields (e.g. "title") via API, which works perfectly fine for the default language. However, I can't manage to populate other languages. So far I tried: $img->title427468 = 'Hello Wereld'; $img->save(); Nothing is saved. Other notations Another approach: $languages->setLanguage('dutch'); $img->title = 'Hello Wereld'; $img->save(); This indeed saves "Hello Wereld" to the dutch custom title field, BUT however DELETES the content in the default title field. The "setLanguageValue"-function is non-existent for the images/files, so it doesn't help. Can anyone help? ? Thank you very much. ❤️
  9. Hey there, we recently took over a ProcessWire project from a different agency, since the client wanted to work with us now. We experienced a weird behaviour and I hope someone can explain it! ? The former agency used a ZebraForm class for formular building which worked/works fine on the clients server, but not on our staging system. The code within ZebraForm is: require rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'languages/' . strtolower(trim($language)) . '.php'; The FileCompiler converts it to: require(\ProcessWire\wire('files')->compile(rtrim(dirname(\ProcessWire\wire("config")->paths->root . 'site/templates/assets/zebra-form/Zebra_Form.php'),array('includes'=>true,'namespace'=>true,'modules'=>true,'skipIfNamespace'=>true)), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'languages/' . strtolower(trim($language)) . '.php'); Error message: Warning: rtrim() expects parameter 2 to be string, array given in /var/www/[...]/site/assets/cache/FileCompiler/site/templates/assets/zebra-form/Zebra_Form.php on line 1076 So to check what went wrong, we changed the syntax within the ZebraForm class to: require rtrim( dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'languages/' . strtolower(trim($language) ) . '.php'; So basically, we put it in new rows... No big deal, no magic. ? The FileCompiler now converts it to: require rtrim( dirname(\ProcessWire\wire("config")->paths->root . 'site/templates/assets/zebra-form/Zebra_Form.php'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'languages/' . strtolower(trim($language) ) . '.php'; Et voila, it works now! Does anyone have any idea why this happened? Asking out of curiosity! Thank you! Niko
  10. Holy shit! That was fast. Thank you very much, Robin!
  11. Hey there, anyone has an idea how to get the HannaDropdown running within a ProFields Table field? I've got a reference to a FieldtypeTextarea with CKEditor where everything is working absolutely perfect, but the HannaDropdown won't show within the inline Editor of the table field. Any clue? ? Thanks, Niko
  12. If I see it correctly, the "other field columns" will be added on a save hook via the $input->post data - which I don't have in my case. In line 1213 it looks like I will have to alter the table in my script. ? Damn! ? Any sweeter way known by someone?
  13. Hey there, I create all my fields with the Migrations module, so I create all my fields with the core functions. Sadly, I'm having trouble creating "otherField" information with ImageExtra. If I try this, the whole field is broken: $myField = $fields->get('test_field'); $myField->otherField = 'copyright'; $myField->otherFieldSettings = "{\"cf_textformatter\":{\"copyright\":\"\"},\"cf_label\":{\"cf_label__copyright\":\"Copyright\"}}"; $myField->save(); Or with an array: $myField = $fields->get('test_field'); $myField->otherField = 'copyright'; $myField->otherFieldSettings = [ 'cf_textformatter' => [ 'copyright' => '' ], 'cf_label' => [ 'cf_label__copyright' => '' ] ]; $myField->save(); I always get this error: ProcessWire: ProcessPageEdit: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_test_field.copyright' in 'field list' Has anyone made any experience with this? Suggestions? ? Thanks in advance!
  14. Hey there, I am trying to install the LanguageSupport module via $modules->install('LanguageSupport') but it won't work. Next time I log in, there's this error: Failed module dependency: ProcessLanguage requires LanguageSupport +1 Failed module dependency: ProcessLanguageTranslator requires LanguageSupport Seems like the "languages" page, the templates and fields are all there, but somehow the Process couldn't be installed. This is the only core module I'm having problem with, if I try to install it via core functions and not the backend. Any hints?
×
×
  • Create New...