Jump to content

Robin S

Members
  • Posts

    5,039
  • Joined

  • Days Won

    340

Everything posted by Robin S

  1. After testing on a few more local sites I can't reproduce the error, so must be something specific to that one site and nothing to bother with. But one new issue I noticed is that it seems Adminer expects its root url to always include a query string. So in the Tracy implementation it can form invalid URLs that lead to a 404. For example, the link back to the database view:
  2. Am going to ditch phpMyAdmin in favour of Adminer. It's a great tool, especially when used in the Adminer Custom theme/plugin bundle: https://github.com/pematon/adminer-custom The JSON preview plugin rules: No problems with refeshing row edit views in Adminer. Was working on my own PW integration but I think @adrian might have something exciting for us all soon... ?
  3. @Pete, seeing as you doing some experimenting with the forum at the moment could you please see if you can adjust the tab size CSS as per the request above?
  4. PageListSelect is different because it doesn't get pages via Pages::find, but rather gets the children of individual pages if they are listable. This is what I came up with: $wire->addHookAfter('Page::listable', function(HookEvent $event) { $page = $event->object; // Page is listable if it is the Users parent or a user page and the current user has a given role if(($page->id === 29 || $page->template == 'user') && $this->wire()->user->hasRole('editor')) { $event->return = true; } }); $wire->addHookBefore('ProcessPageList::find', function(HookEvent $event) { $selector = $event->arguments(0); $page = $event->arguments(1); // Don't check access if getting children of the Users parent and the current user has a given role if($page->id === 29 && $this->wire()->user->hasRole('editor')) { $event->arguments(0, $selector . ', check_access=0'); } });
  5. This is a good outline of the process: https://processwire.com/docs/tutorials/installation-moving-and-troubleshooting/page5 A quote from the article:
  6. You can pass an array of variables as an $options argument to $page->render(). // Render page echo $some_page->render(['animal' => 'cat', 'colour' => 'marmalade']); // In the template file of the rendered page echo "I have a {$options['colour']} {$options['animal']}."; See Ryan's post here for more info on $page->render():
  7. See this note: Because of this requirement this input type won't be suitable for non-superusers to select users because you don't have the possibility to specify check_access=0.
  8. You can also name your files ModuleName.module.php if you like.
  9. v0.1.11 released. Thanks to a pull request from @adrian, this update wraps the last breadcrumb item in a link to the page tree (like the other breadcrumb items) and also standardises the page tree links so they always include an "open" parameter to load the tree opened to the clicked page. This is a change from the core breadcrumbs, which treats the link on parent breadcrumb item differently. There is discussion on this topic here: https://github.com/processwire/processwire-issues/issues/22 My opinion is that the breadcrumb tree links should be treated consistently, and if you want to go back to the page tree in its last state you can click the ProcessWire logo or "Pages" or "Pages > Tree" in the main admin menus.
  10. It sure does - I've built a number of conference sites with PW. So far only information sites, but one of my clients organises several conferences per year and has requested a more sophisticated tool that will serve as a kind of Eventbrite replacement. Looking forward to scoping that out and working on it next year.
  11. It's a bit scary submitting an edit form with data you know is out of date, but you're right that it doesn't save the data if it's unchanged. So that's a good solution, thanks!
  12. I've just been looking at that, thanks. Bummer that it can no longer be easily loaded as a PW page or Process module though:
  13. This is something that has been bugging me for ages and I'm hoping somebody knows a simple trick I'm missing. I am viewing a table in phpMyAdmin - in this case the "fields" table: I want to take a closer look at the data column in the link_url row, so I open the row for editing via the "Edit" link: Now in the PW admin I make some changes to the link_url field settings, and want to check the results in the table row. So I want to reload the edit row view to see the changes... but the URL that phpMyAdmin uses for this view is http://localhost/phpmyadmin/tbl_row_action.php - there's nothing specific to the currently edited row in the URL, and when I refresh the page I am sent back to the phpMyAdmin landing page. I figure there has got to be some way to refresh the edit row view without this happening - isn't refreshing a view like this a really common need? Maybe there is some button in the interface that reloads the edit view that I am missing? Any tips much appreciated. P.S. I know I can show non-truncated column values in the table view and also edit column values in the table view, but the interface is much more crowded and busy here than it is in the edit row view, so it's not a great substitute.
  14. I could reproduce this locally too with DatetimeAdvanced v1.0.0, PW 3.0.115, PHP 7.1. It seems that when a new page is created (after the first step of Add Page) the field gets a value of 0000-00-00 00:00:00 in the database. This gets converted to timestamp -62170025400 which then does not pass the conditional that sets the inputfield value to the current date/time. In contrast, the core Datetime field does not set a value in the database until one is saved. DatetimeAdvanced: Datetime:
  15. @ryan, I'm sure it's just a temporary glitch relating to the ongoing work you're doing on the docs, but I notice that many methods are showing "@since 3.0.110" when they have been around much longer than that. Example: https://processwire.com/api/ref/inputfield/
  16. This one? https://processwire.com/videos/overview/ Love that video. It was my first contact with PW and after seeing it I was sold.
  17. @BitPoet, what do you think about changing from SQL timezone support being a strict requirement for installation to it being a strong suggestion? My shared hosting server doesn't have timezone data but if I comment out the WireException in the install() method then things seem to work okay. The field values are saved with the correct date and time in the database and I can match pages as expected. Not sure if that means that the server's SQL and PHP are set to the same timezone (not sure how to test that). The only issue I noticed is that with the "Default to today's date?" option selected in the field config the field shows an invalid date before a date has been entered: Would that be due to the missing timezone support?
  18. $all_match = true; foreach($items as $p) { $pp = $this->pages->get($p->product_id); if($pp instanceof RepeaterPage) $pp = $pp->getForPage(); if($pp->my_field != '3') { $all_match = false; break; } } // do something according to the value of $all_match
  19. Ryan, you're an absolute champ for grinding away on the documentation. We all know it's a developer's favourite task. But seriously, thank you.
  20. What @elabx said. And... ...is that intended to be a sub-selector? If so you need to use square brackets. $query .= 'guests=[party_guests>=1, party_guests<51], ';
  21. In the getSelectablePages() hook $event->arguments('page') is the page being edited, but that is not so useful in your case because what you want is the Repeater page that contains the two Page Reference fields. Give this a try: $wire->addHookAfter('InputfieldPage::getSelectablePages', function(HookEvent $event) { if($event->object->hasField == 'people') { $inputfield = $event->object; $repeater_page = $inputfield->hasPage; if($repeater_page->team && $repeater_page->team->id) { $event->return = $event->pages->find("template=user, team=$repeater_page->team"); } } }); Note that if the user changes the selection for the team field they will need to save the page before the selectable options for the people field will update.
  22. How about getting the url-segments/page-num/get-vars suffix and then appending that to $page->localUrl? $url_suffix = str_replace($page->url, '', $input->url(true)); $redirect_url = $page->localUrl() . $url_suffix;
  23. Hi Adrian - is the gap between the dump heading and the dump output deliberate? I think it would look better without a gap.
  24. Not easy using the core Datetime field type alone AFAIK. The DatetimeAdvanced module by @BitPoet supports querying by month, but see the notes about timezone support in the module readme. An alternative would be to add a hidden integer field to the template and save the month number to that in a saveReady hook, then use that field in your selector.
×
×
  • Create New...