-
Posts
11,205 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
Not sure if that's the best approach ? With page reference fields I think you want to go with a custom selector and add "check_access=0" to the selector.
-
Create Field from API and give read-access only to superusers
adrian replied to markus_blue_tomato's topic in General Support
@tiefenbacher_bluetomato - Just a quick note to say that I just pushed another revised version that fixes a bug in the previous one, so please be sure to update if you want to use this feature. -
Create Field from API and give read-access only to superusers
adrian replied to markus_blue_tomato's topic in General Support
I have just added access rights to TracyDebugger's RequestInfo > Field Code section. It now contains: [ 'type' => 'FieldtypeText', 'flags' => '32800', 'name' => 'my_field_2', 'label' => 'My Field 2 Label', 'collapsed' => '0', 'minlength' => '0', 'maxlength' => '2048', 'showCount' => '0', 'size' => '0', 'tags' => '', 'editRoles' => [ 'editor', ], 'viewRoles' => [ 'author', 'editor', ], 'textformatters' => '', 'showIf' => '', 'themeInputSize' => '', 'themeInputWidth' => '', 'themeOffset' => '', 'themeBorder' => '', 'themeColor' => '', 'themeBlank' => '', 'columnWidth' => '100', 'required' => '', 'requiredAttr' => '', 'requiredIf' => '', 'stripTags' => '', 'placeholder' => '', 'pattern' => '', ] which is everything to need to create a field via the API including the view and edit restrictions. You can then simply wrap this output in: $f = new Field(); foreach() $f->save(); so that you have: $f = new Field(); foreach([ 'type' => 'FieldtypeText', 'flags' => '32800', 'name' => 'my_field', 'label' => 'My Field Label', 'collapsed' => '0', 'minlength' => '0', 'maxlength' => '2048', 'showCount' => '0', 'size' => '0', 'tags' => '', 'editRoles' => [ 'editor', ], 'viewRoles' => [ 'author', 'editor', ], 'textformatters' => '', 'showIf' => '', 'themeInputSize' => '', 'themeInputWidth' => '', 'themeOffset' => '', 'themeBorder' => '', 'themeColor' => '', 'themeBlank' => '', 'columnWidth' => '100', 'required' => '', 'requiredAttr' => '', 'requiredIf' => '', 'stripTags' => '', 'placeholder' => '', 'pattern' => '', ] as $k => $v) { $f->$k = $v; } $f->save(); So to get this to work, create a field via the PW admin and set it up exactly how you want with the access restrictions, then go to the RequestInfo panel and copy the array from the "Field Code" section. Note that this section is not turned on by default when you install Tracy, so you will need to go to the config settings for the RequestInfo panel and turn it on. -
Congrats Margaret on getting this up. PW makes a great tool for conference websites, especially for setting up conference schedules/programs using repeater fields:
-
Just wanted to let you know, that this will no longer be a problem. I have removed the code that cleared the sticky panels cookie when saving the config settings. I'll keep an eye on things because I am still not sure exactly why I added it in the first place, but it's definitely annoying ? On another note, core modules and site modules classes are now optional available in the API Explorer panel, along with lots of other improvements.
-
Questions and Answers forum desperately needed. AKA mark as solved.
adrian replied to dotnetic's topic in Wishlist & Roadmap
I agree - I am not saying that something like it shouldn't be implemented - just wanted to expand on @kongondo's answer and explain what we found about it that didn't work well, and the way it was, it really wasn't helpful. Maybe Ryan could reconsider it (or another similar approach) with the website revamp. -
Questions and Answers forum desperately needed. AKA mark as solved.
adrian replied to dotnetic's topic in Wishlist & Roadmap
If my memory serves, it was because it ruined the flow of the thread. In a lot of cases we are not looking for a single "best answer", but rather it's a discussion of different approaches. That said, it obviously works pretty well on StackOverflow so I think it's something to consider again, but I don't know which boards should use it and which shouldn't and I think that was part of the problem with the attempted implementation at the time. -
Selectors can only be strings, newlines make selectors buggy
adrian replied to theoretic's topic in General Support
You might find what you need in this post: https://processwire.com/talk/topic/19024-selector-arrays-with-page-reference-fields-with-and-not-or/ -
Thanks for doing that test. Now the problem is that I am not really sure what to do. You do have the option to change what tabs are output: so I guess if you're coming across this a lot and don't want to (or can't increase) the PHP memory limit, then perhaps the best option is to drop back to one tab. Would you mind confirming that works for me?
-
Would you mind checking what is the last old version of Tracy that doesn't have an issue with that hook in your setup? If there has been some change, I'd love to help sort it out. Perhaps it's when I introduced the debugInfo / Iterator / Full Object tabs in the dumped results? This is the commit where this was first introduced: https://github.com/adrianbj/TracyDebugger/commit/104a9457ec1eae78b46d139a631f798b2a042bf0
-
Hi @Zeka - I think is probably just a result of trying to bd() lots of complex PW objects. Try replacing the bd call with bd($e->object->title) and see if that helps. Or maybe you could use bd($e, [1]) as a shortcut to reduce the maxDepth of the dump. The main thing is I don't think it's a problem with Tracy but rather just how much content is being dumped. How many bd() calls are being made in this hook in your setup?
-
Inline with my last comment, I am thinking about adding an alert (with orange icon) when there are new properties/methods available after you upgrade to a new version of PW. Haven't decided on the exact interface yet, but if you like the idea and have any thoughts, feel free to suggest, but probably a simple note at the top of the panel detailing those new options and also highlighting in the tables. Probably with an option to "acknowledge" that you've seen the options to remove the notice. Something like that anyways.
-
New post: Rebuilding processwire.com (part 2)
adrian replied to ryan's topic in News & Announcements
Me too! -
New post: Rebuilding processwire.com (part 2)
adrian replied to ryan's topic in News & Announcements
Thanks @ryan - excited to see it. Regarding the new "numParents" method/property, you are missing the @property in the Page.php doc comment. -
I can confirm that today's updates have fixed the Profields Table field error I was getting. Not sure about the PHP <7 errors though as I am on 7.
-
-
Tracy's settings contain an InputfieldEmail field so I expect that is where the conflict is. You need to add a condition to your hook to make sure it's only affecting ProcessPageEdit rather than ProcessModule and others. Sorry, gotta run so now time for an example, but hopefully that will get you going.
-
Lots of improvements to the API Explorer have been committed and as far as I can tell it should now include all methods and properties for all PW objects and classes. It's now definitely ready for primetime although I am sure I'll think of other improvements to add ? Honestly I am learning about lots of methods/properties I didn't know about! Hopefully you guys will find it the best first stop for api docs.
-
And everything works as expected when Tracy is uninstalled? Can you save config settings for other modules? Any chance you could try an older version of Tracy - I wonder if I recently did something that makes it require a new version of PW?
-
Agreed - I honestly didn't pay much attention because it said "coming soon" and I was happy to see PW included along with Wordpress and Joomla.
-
Sorry for the trouble - what version of Tracy, PHP, and PW are you running?
-
Themes for PW: https://prothemes.studio/
-
Do you have PW's debug mode on? If not it suppresses PHP errors. Alternatively, TracyDebugger will in most cases display these errors even with debug mode off.
-
Another question for you all - in addition to the core objects and classes, would you find it useful to also see these for core and site module classes as well? Maybe optional?
-
New version of the API Explorer. 1) It now shows all core classes (rather than the previous select list), but it excludes those classes with matching API variables avoid duplicate content. 2) By default, methods inherited from Wire, WireArray, or WireData are no longer shown which dramatically decreases the size of the panel and makes it much easier to find what you are looking for. However if you want to see all methods, then you can check the new "Include inherited methods" config setting. I would really appreciate some feedback on this new version. I am thinking about maybe showing inherited methods for the core classes, but not for the API variables (objects), but I'd really like to get thoughts from you guys on what you think will be most useful - I think it's a challenge to balance usefulness and clarity. Thanks!