chcs

Members
  • Content count

    15
  • Joined

  • Last visited

Community Reputation

6 Neutral

About chcs

  • Rank
    Jr. Member

Profile Information

  • Gender
    Female

Recent Profile Visitors

188 profile views
  1. Hi @joshuag we're having some problems. Background info, we have an "event_date" recurme field on the "event" template. Simple case studies, I have three event pages. start_end - a one day event with a start and end time all_day - a one day, all day, event three_days - a recurring event that has a start/end time, repeated every day for three days in a row. oddity #1 - "data" when you land on their respective pages, <?= $page->event_date; ?> yields a json object (expected). the "dates" key in that object is populated with an array of three dates for the three_days event. however, with the other two pages where you'd maybe expect one date in the array, there's hundreds, stretching for about eight years. https://pastebin.com/1URSn6pF oddity #2 - $event->start_date as noted in the documentation, one is expected to get the event data using $event = $recurme->event($page); Now that we've acquired the recurme event object, I would expect access to the date of the event once the user is on the page of the event. start_end <?= var_dump ($event->start_date); ?> == NULL all_day <?= var_dump ($event->start_date); ?> == NULL three_days <?= var_dump ($event->start_date); ?> == int(1534968000) The first two single day events being expected to return a result considering there is only one set. The null problem extends to other properties of $event, eg: *->orig_date, *->date, *->month, etc. with the expected strings only existing in the recurring event page. working off this problem... oddity#3 - $event->start_date for recurring events Your $recurme->renderCalendar() or $recurme->renderList() methods render links for the event pages, and taks on a querystring which seems to indicate the start date of the events. However, like the above, the start_end and all_day pages, with querystrings still yield nothing when trying to extract the date conveniently from the $event object. Furthermore, with recurring event three_days is on the 22nd of august, 23rd, and 24th. Landing on the the page, with its respective querystring, yields the wrong date. for example: foo.com/events/three_days/?date=1535140800 One would arrive at the above page from clicking through from the rendered list, or rendered calendar. However, now echoing the date for the event <?= var_dump ($event->start_date); ?> you would expect to see the integer/date strings for the august 24th date, but you actually get the original from aug 22. This problem extends into all the respective strings. eg: foo.com/events/three_days/ <?= $event->date ?> == "Aug 22, 2018 @ 1:00 pm" foo.com/events/three_days/?date=1534968000 <?= $event->date ?> == "Aug 22, 2018 @ 1:00 pm" foo.com/events/three_days/?date=1535054400 <?= $event->date ?> == "Aug 22, 2018 @ 1:00 pm" foo.com/events/three_days/?date=1535140800 <?= $event->date ?> == "Aug 22, 2018 @ 1:00 pm" The first two being expected/correct. The latter two I would expect to be Aug 23 and 24 respectively considering these links were generated through the calendar. --- I'm not sure how to proceed exactly. Certainly I can jump through some hoops on my own end and grab the query string if it exists, or output arrays of dates if it doesn't, and parse json for single day events with no recurrences... but it seems like I am spending more time testing and debugging contingencies than having the field work in ways I expect it to. Is there maybe something I can do to think about this in a different way, or perhaps some sort of new version (i'm using 1.0.3 and a new dev version of PW)? Thank you!
  2. chcs

    Setting 'autoload' => true in the module info worked. Thanks!
  3. $field->template_id = $this->templates->get("mm_state")->id; That worked! Thanks
  4. After running this code in my module's __install() the template_id is not set. Any ideas why? (The export contents from the template created and the one that I built with Admin are the same. Both exports have the template_id is set to mm_state. When I go to edit the field in Admin, the template is not showing on the Input tab and it doesn't show the template title on a page using the template that uses this field. Using processwire 3.0.98) // mm_state $field = $this->fields->get('mm_state'); if (!@$field->id) $field = new Field(); $field->type = $this->modules->get("FieldtypePage"); $field->name = 'mm_state'; $field->label = 'State'; $field->derefAsPage = 2; $field->inputfield = "InputfieldSelect"; $this->fields->save($field); $field->labelFieldName = 'title'; $field->template_id = 'mm_state'; $field->columnWidth = 100; $field->required = true; $this->fields->save($field);
  5. It seems that the confirm field in this module get it's id based on the name attribute instead of the id attribute . So if one changes the id attribute to a value other than the name, the confirm input id is not effected. I consider this a bug. In the module that I am developing I have multiple tabs with forms in multiple tabs. This causes id duplication when using the InputfieldPassword field on two different tabs. I can get around the problem by specifying the id for the field, but in the case of the InputfieldPassword field, it bases the Confirm id attribute on the name attribute instead of the id attribute. I am using ProcessWire 3.0.98 and have attached the modified module (see lines 209 and 241) InputfieldPassword.module
  6. chcs

    I put the following code into our membership module but it does not seem to redirect. Any ideas why? Thanks. public function init() { parent::init(); // set landing page $this->addHookAfter('Session::loginSuccess', null, function($event) { if (!$this->wire('user')->isSuperuser()) { $path = $this->wire('config')->urls->admin . "membership/"; $this->wire('session')->redirect($path); } }); }
  7. @kixe Thank you for responding. Perhaps we need a broader understanding of what is involved? The module we are developing is client-specific, and is not really applicable to the broader community, so registering at modules.processwire.com doesn't seem to make sense. So it seems we would need to create a private module feed to keep these modules up to date across sites? Is there documentation on that, or is there an alternative that will scrape the module code of a private repo to generate it? Your first solution regarding changing the moduleServiceUrl to this private feed, would that unhook the site from modules.processwire.com for core updates and free-use plugins? Thank you again for replying and helping us work through this.
  8. chcs

    I would like to be able to to specify an admin page that the user lands on based on their role. I would also like to be able to specify this landing page when automatically logging on using the API. Any ideas are welcome.
  9. I am trying to figure out the best way to handle developing a module for multiple private ProcessWire sites. The key issue being: when I update the module, how can I elegantly get the changes in the sites that use it. It would be nice to not have to copy/ftp the files from site to site, or entangle them in git history (maybe as a sub module?) The ProcessWire modules directory has a nice upgrade module which can elegantly notify/click+upgrade publicly hosted repos. But this would be private code hosted on a private repo. I assume this would preclude it from being hosted there? Can someone point me to a solution for this, or perhaps brainstorm any possibilities.
  10. @Robin S perfect solution thank you so much! @OLSA very good to know another way to tackle the issue, thank you.
  11. Oh I didn't see that option in ASM, I've been using the typeahead. Not a bad, but requires a save before one can edit.
  12. In the page reference field, one can create new pages if they enable that option. However, the "new" page only gets the title field filled out. Q: Is there a way to expand on this so a user can fill in more fields from the new page? Either in-line or via modal?
  13. Reporting back to confirm that it was a max_input_vars issue. Once changed locally, the pages saved as expected. As well, once changed on the production server, the clone and original began to save again.
  14. I've now gone ahead and exported the whole site to test on a local environment. when i save i get the following (php?) error (warning?) in the top of the page @wbmnfktr in response to you: 1. no js errors 2. no PW log errors 1. not sure how to refresh all modules? i'm scared of losing data (eg if i unload the repeater module) 2. i've nuked all compiled files 3. i've logged out and in.. 4. it's not a cache issue because i've used incognito windows and chrome dev and other browsers 5. same issue firefox/edge 6. same as #1 nervous about losing data 7. i don't have any custom hooks for back end stuff. it's pretty stock.
  15. I have a page with a good amount of fields on it, I have many other pages in the same template that have no issue, but one particular page just doesn't save changes to any of the fields. I installed the clone page module, cloned the page, and everything cloned fine... but still when i try to make changes to the clone nothing saves either (just like the original page). I expect some kind of notification to show up saying it saved, or not, but i get nothing as if the page reloaded fresh. The failure is silent, and there's nothing in the logs to direct me. This is a real head scratcher and I'm not sure how I should go about troubleshooting it further. Can someone help? Thank you kindly.