Jump to content

Kiwi Chris

  • Content Count

  • Joined

  • Last visited

  • Days Won


Kiwi Chris last won the day on November 13 2017

Kiwi Chris had the most liked content!

Community Reputation

158 Excellent

About Kiwi Chris

  • Rank
    Sr. Member

Profile Information

  • Location
    New Zealand

Recent Profile Visitors

1,100 profile views
  1. I've done some further investigation, and on a site without this module, Lister/Lister Pro will show hidden + unpublished as long as the template itself has access control set. It won't work if only the parent has access control set. Access control must be explicitly set on the template in question, as Lister (Pro) doesn't appear to look at access control inheritance. With AdminRestrictBranch installed, even if a template does have explicit access control, and no other modifications to access control, it does seem that the hidden + unpublished option in Lister/Lister Pro doesn't work, although using the include all hook, or doing the equivalent creating the lister via the API, setting allowIncludeAll property to true, and including include=all in initSelector property of the lister does provides provides the expected results.
  2. Yes, I've now also confirmed on a site that doesn't have this module installed. I'll go back to @ryan and ask him about ListerPro. It has an option to include hidden + unpublished but doesn't actually do anything. Thanks for the workaround. If I get ListerPro working as expected without this module without needing a workaround, I'll recheck again with this module to confirm it has no side effects.
  3. Thanks. This provided the result I needed. I actually added it to a custom module that added the hook, but same result.
  4. @adrian I already have that option configured. In lister I get a message: I know this issue has come up before, and Ryan has asked people to check if they have anything that is hooking permissions. With my site structure I have multiple clients who are restricted to what they can edit via this module, however they all have pages they can edit using common templates, so there will be some pages using a given template a user can edit and others they can't. The template in question in my lister definitely is editable for the user, and published pages for the user show up fine. I think AdminRestrictBranch is the only module I have installed that does hook permissions, so I thought it would be worth checking whether other people are using it and Lister/ListerPro together successfully.
  5. I'm not sure whether it's relating to having this module installed or Lister/ListerPro by @ryan but I seem to be having issues displaying unpublished pages in Lister/ListerPro, and Ryan did mention to check on any other modules that modify permissions. Is anyone else using this with custom Listers or ListerPro? If so, are users able to view their own unpublished pages OK?
  6. Oops! I copied and pasted from the example you gave a few posts back. That will teach me for just copying without trying to understand the code. 😉 I realise RockFinder and RockGrid are still works in progress, and full documentation is coming. 🙂 Another issue I've struck is I get the following error in the RF2 sandbox: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bottlingco_pw.field_stockCode' doesn't exist (field is added via $rf->addColumns) If I change the field name to all lower case (stockcode), I get no error, but RockTabulator just shows 'Field not found' in the sandbox RockTabulator. It seems as though RockFinder is not translating a Processwire field name with an uppercase character in it into lowercase for the SQL query.
  7. Commenting out: $grid->setData($rf); Got the grid to display in the sandbox.
  8. I'm getting there... The order of installation turns out to be fairly important: RockMarkup2 then RockTabulator then RockFinder2 I've got them all installed ok, but I'm getting the following error: Call to undefined method stdClass::setData() in RockFinder2 on this line: $grid->setData($rf); Also I get a : 1× PHP Warning: Creating default object from empty value in when I save in the sandbox I'm running PHP 7.2
  9. Thanks. I've already used your tutorial on building custom admin pages and found it really helpful. Rockfinder2 + RockTabulator are new to me, but it looks like they'll do what I want.
  10. I have a site with the following structure: User -Orders -Materials User 2 -Orders -Materials ...etc I'm using AdminRestrictBranch module with custom PHP code, so that users when they log in, can only access their records. return ($user->hasRole('client')) ? '/clients/'.strtolower($user->clientCode): '/'; So far so good... Now I've been asked to add a new component in addition to the orders and materials, 'dispatch', however where this gets complicated, is I've been asked to separate this off and show it as a separate tab at the top (ie where Pages, Setup, Modules, Access etc go). I know everything in Processwire is essentially a page, and Modules and Access have their own links as they are sub-pages of Admin, so I can create a new link up here OK. The problem is with the default setup, you give access to one of these features or you don't. What I need is to be able to do is assign all users with role 'client' access to certain functions, but ONLY let them edit, view and create their own records. I can probably store the dispatch data under the user like I've done with Orders and Materials, but if so, I'll need to hide the page tree and create a separate dashboard so that I can have Orders and Materials under one heading, and Dispatch under another. One option I've seen that I wonder whether might be helpful, is Lister Pro. I don't have the module yet, and I can't tell clearly enough from the module documentation whether it will help me achieve what I need. I definitely don't want people with 'client' role being able to change what pages to show in lists themselves, but I do need them to be able to see their own records, edit them, and add new ones. Will Lister Pro help accomplish what I need, or are there other ways to achieve what I need, and importantly, what's likely to be the most efficient approach?
  11. I've tracked down the issue. Thanks @dragan for the example of how to use d function. it turns out one field in the selector had a leading space in the record that's not being returned, however it doesn't show in the editor. By changing the offending field, saving it, then changing it back, it made it have the correct value. I couldn't just save it, as Processwire didn't consider the field changed, even though it stripped out the leading space before displaying it in the editor. ie I had a text field productType that was supposed to be "FG" but was actually " FG" however editing the page displayed it as "FG". The record was orginally imported from CSV, so I either need to get my import to strip leading spaces, or get the editor to display them.
  12. I have a selector that matches on several fields to provide the records for a page reference field, but is behaving strangely with a couple of records. The two records use the same template and have identical field values for all fields but for the title and another field pageDescription which are not included in the filter. Both pages are visible and published, but only one page is returned, although if I do a search directly for the title of the page the selector does not return, it shows up. Does anyone have any idea why a selector would not return a matching record? Is there any possibility of database corruption (I'm using InnoDB)
  13. What I had to do was create two websites with webfaction, one using HTTP and one using HTTPS Go to Domains/Websites, then Websites In the HTTPS site, just use the standard Processwire .htaccess and make sure you've got the site set to use HTTPS. Create another site, using static/CGI/PHP template will do with the same domain name, but make sure it is using HTTP (not HTTPS) and in that one add the code you posted to the .htaccess file of the HTTP site.
  14. I've checked what $event->argument(0) is returning, and it actually is the page the repeater is used on, even though that page doesn't directly have the field 'bom' as that is only used in the repeater itself, so even though the repeater item is technically a page in its own right, my hook is picking up the page the repeater is on anyway. My filter seems to be working as expected now. I think the issue arose because previously I was using a pagetable instead of a repeater, but the client didn't like the presentation, and found a repeater more intuitive. The client only needs a few items, sometimes only one, so a repeater makes sense. With the pagetable, I did need to refer to the parent, and with the repeater items technically being pages, I assumed I needed to do the equivalent, but it turns out that with repeaters the page they're used on is the page returned by the hook.
  15. I'm trying to apply a custom filter on a page field within a repeater via ready.php like so: $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if ($event->object->hasField == 'bom') { $parent = $event->arguments(0)->page->getForPage(); } // Filter criteria ... } The problem is I get "Call to a member function getForPage() on null" on the line: $parent = $event->arguments(0)->page->getForPage(); Any idea what I'm doing wrong?
  • Create New...