adrian Posted September 19, 2013 Posted September 19, 2013 Hey Nic, Just playing around with multi-language fields for the first time and noticed that if I set the Title field to "PageTitleLanguage", then the titles for all the results in the tree are [object Object] Thanks 1
nik Posted September 20, 2013 Author Posted September 20, 2013 Thanks adrian! I actually thought I had fixed that months ago... And I had, but the changes unfortunately never made their way into GitHub until now. Anyways, multi-lingual titles are now fixed. Also, I pushed a little new feature as well: now you're able to choose a role and page permissions are shown for that role for each listed page. Hovering those yes/no texts gives a short explanation (as the titles are just single letters to keep it compact). 3
LostKobrakai Posted June 17, 2014 Posted June 17, 2014 I get an error, if I try to find users based on roles like this. template=user,roles*=candidate SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '='candidate' JOIN field_roles AS field_roles ON field_roles.pages_id=pages.id A' at line 3 Greetings, Benjamin
nik Posted June 17, 2014 Author Posted June 17, 2014 Hi Benjamin! That kind of selector is not supported in the core apart from dev version. I'm not sure exactly when selectors have been updated to allow wildcard search to the names of pages via a page reference (which "roles" is), but that seems to work in the latest dev at least. Then again, the module doesn't handle these kind of errors too good - you need to logout and login again to get rid of the error as the selector is saved in the session. Maybe I should try and find a better way as I've been tripped by this behavior myself a couple of times as well. But meanwhile, and to achieve what you were trying to do, update the PW core if possible. That should do it. 1
lsag Posted October 18, 2014 Posted October 18, 2014 gee, this is sooo cool!!! it's such a pain to discover the right variables for the templates, in other cms's! 1
evanmcd Posted January 8, 2015 Posted January 8, 2015 Hi, this has been a favorite module of mine, but I'm finding that it doesn't work with v2.5 (specifically 2.5.3). I get this error when loading /setup/selector-test/: Error: Call to a member function getArray() on a non-object (line 700 of /Develop/Source/site/modules/ProcessSelectorTest/ProcessSelectorTest.module) Is there another way to do this using Lister that I don't know about? Thanks.
gmclelland Posted September 19, 2016 Posted September 19, 2016 I just installed this on 3.0.33 devns and so far it seems to work fine.
szabesz Posted September 19, 2016 Posted September 19, 2016 Just for the record: It is also possible to test selectors easily with @adrian's Tracy Debugger module, e.g.: https://processwire.com/blog/posts/introducing-tracy-debugger/#console-panel andhttps://processwire.com/blog/posts/introducing-tracy-debugger/#want-a-quick-way-to-see-the-results-of-a-pw-selector 3
gmclelland Posted September 19, 2016 Posted September 19, 2016 I already had Tracy Debugger installed, but didn't know about this. Very nice, thanks szabesz! 1
adrian Posted September 19, 2016 Posted September 19, 2016 4 minutes ago, gmclelland said: I already had Tracy Debugger installed, but didn't know about this. Very nice, thanks szabesz! Just an FYI, when using the console, d() is usually more useful than bd() as it will put the results at the bottom of the console panel, rather than needing to open the dumps panel to see the results. 1
netcarver Posted October 10, 2016 Posted October 10, 2016 If anyone is interested, I just pushed a couple of updates to my fork of Nik's excellent module. This version adds logging of selector string and the result summary - something I was missing as I'd kind of play with the string, hit a selector that worked for me and promptly loose it by fiddling some more with it. You need to look in the log (or use the log viewer) to find the previous strings - but at least they are there. Additionally, the forked version adds a hook to allow custom titles to be generated for repeater fields (Shown below with custom titles for the relationships repeater) The code to produce the custom label being... /** * Custom hook to format repeater field labels in ProcessSelectorTest results... * * Turns labels from ... to => ... this * * '0' => '0 Parent of: Jack, Jane, Jill' * '1' => '1 Coach of: Anne, Benjamin, Connie, Dick, Emily, Faith, Gill' * '2' => '2 Spouse of: Richard' */ $pages->addHookAfter('ProcessSelectorTest::formatRepeaterLabel', function($event) { $replabel = $event->return; $parent_field = $event->arguments(0); $repeater = $event->arguments(1); if ('relationships' == $parent_field->name) { if ($repeater->people) { $replabel .= ': ' . $repeater->people->implode(', ', 'title'); } } $event->return = $replabel; }); I'll issue a pull request to Nik - but he's not been particularly active here recently. 4
adrian Posted October 10, 2016 Posted October 10, 2016 Nice work Steve! 5 minutes ago, netcarver said: You need to look in the log (or use the log viewer) to find the previous strings - but at least they are there. Sounds like a perfect use case for the log viewer in Tracy 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now