-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
One tweak that I think is worth making is to use: $e->object->getPage() rather than $this->input->get('id') to get the page being edited. /** * modify headline in page edit interface */ $wire->addHookAfter('ProcessPageEdit::headline', function($e) { $pageBeeingEdited = $e->object->getPage(); if (!$pageBeeingEdited->id) return; $headline = "My ID is $pageBeeingEdited->id"; $this->wire('processHeadline', $headline); // no need to modify the return value ($e->return) });
-
Just wanted to explain @kixe's excellent answer a little for those who might be wondering why that hook isn't listed in the Tracy Captain Hook panel or on the Captain Hook page: https://processwire.com/api/hooks/captain-hook/ What is going on is that ProcessPageEdit extends Process and Process has a ___headline() hookable method. If you're used the Tracy Captain Hook panel, it always pays to check the class that the current class extends: Now we're looking at the hooks for the Process class and we can see that headline is available. Hope that helps! The other useful tip is the to click the "Toggle All" button at the top and CTRL/CMD +F and look for "headline"
-
Hi @OllieMackJames - I'm afraid I don't have the time to do this at the moment, but I am sure you can extend the "Copy Repeater Items to Other Page" action to support RepeaterMatrix fields - probably just a matter of another loop. If you make those changes, I'd really appreciate a PR Let me know if you have any questions.
-
@Jon - just took a look and can't seem to reproduce. What version of the module are you running? Can you please details of the code in the template file, and your auto prepend/append settings please?
-
@Jon on mobile right now, but just wondering if the chosen template file is actually connected to a PW template. It doesn't need to be and maybe that is the issue but I'll have to check when I'm back at my desk in the morning.
-
How to set field to autojoin via API?
adrian replied to Jonathan Lahijani's topic in API & Templates
Actually, you probably want $field->addFlag(Field::flagAutojoin); $field->save(); so you don't remove any other existing flags. -
Large files get to 100% and then hang when uploading
adrian replied to JoshoB's topic in General Support
Tracy can really help with reporting of image upload errors - usually you'll get warnings/notices in the the errors panel, or you'll get Tracy's "Buescreen" for fatal errors. -
How to set field to autojoin via API?
adrian replied to Jonathan Lahijani's topic in API & Templates
Autojoin is a flag, like system, global, etc: $field->flags = Field::flagAutojoin; $field->save(); -
https://www.websprudel.de/processwire-ein-cms-das-sich-anzuschauen-lohnt/
-
Here's the info on each() https://processwire.com/blog/posts/processwire-core-updates-2.5.27/#new-each-method-added-to-all-processwire-arrays On a related note, it's also worth reading about these related methods https://processwire.com/talk/topic/5098-new-wirearray-api-additions-on-dev/
-
Sorry, I have no idea what that means Could you explain a little more, or do a screen recording please. I don't see an issue here on FF on Mac, but maybe there is something with the Linux version?
-
PS - don't forget ->each("title") when testing page selectors so it's easier to see what pages are matched.
-
It does look like the initial resize hasn't worked properly - maybe I need to test Firefox. Try dragging the resize handle (between the code and results pane). Also, if you click the Console panel icon (rather than hover) and then click the "large" up arrow at the top right. The large version will be kept unless you revert. Let me know if you have trouble getting that to work.
-
foreach iteration to create nested fieldset items
adrian replied to Federico's topic in Module/Plugin Development
You don't even need to do that If you have the Request Info panel running, you will see the POST variables automatically populated - depending on your scenario it might be in the main bar, or the "redirect" bar., -
I think that integrity constraint violation definitely needs attention! But back to the issue at hand - have you tried using Tracy in Production mode to log the errors. When she emails, she only sends one until you clear the sent email flag, so your inbox won't be bombarded with repeat errors. Tracy also has Slack and Monolog adapters: https://componette.com/search/tracy available, but I guess it wouldn't be hard to write a Jira one if you prefer that.
-
I don't think it needs to be automatic, but perhaps the instructions could be expanded. Currently all they say is: "Create your processes then enter a path to the json or php definition of the fields in the path field." and that didn't initially make sense to me. I think spell it out: 1. Create a page under Admin (at the top level or under Setup if you prefer) 2. Save the page and then choose the ProcessSettingsFactory process from the dropdown. 3. Enter the path to youre settings file. Not sure using a placeholder is good the way you did - I actually thought it was already filled out with: settings/site-settings.php I also think you should say included "samples", not examples, because of the folder they are stored in. Hope that helps.
-
Hey @Macrura, I was surprised that the Process module didn't automatically create its own page, so I was a little lost for a minute or two, but otherwise looks great and looking forward to using it - thanks for the hard work!
-
For me it's a mix. I really like a GUI for visually reviewing the code changes in all files before committing. But for checking out and pulling updates from other (not my) repos, I use the command line.
- 242 replies
-
- 1
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
User with "user-admin-all" can't make another user an "editor"
adrian replied to Sergio's topic in General Support
Yeah, the "user-admin-all" is very strangely named I think: https://processwire.com/api/user-access/permissions/#user-admin-permissions The description says that it reduces the user's rights to guest users only and then you build up from there with the user-admin-[role] option. All that said, I still think we need a way to let a user with some user-admin permission create another user also with this ability. Otherwise you can't let a client handle the creation of new users in their organization who can also do user management. -
User with "user-admin-all" can't make another user an "editor"
adrian replied to Sergio's topic in General Support
I just came across this also. I think that even though this is clearly intentional: https://github.com/processwire/processwire/blob/bafe3d4a1289f6d225c657c4206c27c7a27a5b14/wire/modules/Process/ProcessUser/ProcessUser.module#L211 it is problematic if you want to give a user the ability to create other users with the ability to also create users. I think this should be a Github issue - anyone else have any thoughts? If you need a quick fix, you could comment out the line shown above. -
I think this is the new current feed
-
Live right now:
-
How to output wire message after running a hook problem
adrian replied to Juergen's topic in API & Templates
Not sure it's actually an optimization - more of a reduction and maybe a simplification depending on how you look at things. It also might handle template names without any additional logic which can also be nice. -
How to output wire message after running a hook problem
adrian replied to Juergen's topic in API & Templates
Just a quick note on the $page->template to $itemtemplate conversion. You could replace all that logic with: $itemtemplate = rtrim(str_replace(array('event_', 'special', 'business'), array('single-', 'special-', 'business-'), $page->template), 's'); It's really up to you whether this seems nicer or more complicated