-
Posts
11,125 -
Joined
-
Last visited
-
Days Won
366
Everything posted by adrian
-
Try this as a replacement for https://github.com/adrianbj/PageRenameOptions/blob/8665aca5023417163841603fda8037df2ccbe245/PageRenameOptions.module#L106-L108 Not well tested yet, but wanted to give you a better idea of what I meant. preg_match('/\(copy\s?\d?\)/', $p->title, $matches); $isTitleCloned = !empty($matches) && $p->name != $this->wire('sanitizer')->pageName($p->title, Sanitizer::translate); if(!$isTitleCloned && $this->data['initialDifferencesProtected'] && !$this->wire('user')->roles->has("name=".implode("|", $this->data['exemptRolesInitialDifferencesProtected']))) { $this->wire('config')->scripts->add($this->wire('config')->urls->PageRenameOptions . "InitialDifferenceProtected.js?v={$version}"); }
-
What about if the module were to just disable the Initial Differences Protected check if the name doesn't match the title but the title contains (copy\s?\d?\) which would match (copy), (copy 2), etc. I think this approach will work better. Thoughts?
-
Hi @Robin S - sorry for the really late response. Looks like your suggestion for matching the cloned name to its title works for me. Would you mind testing at your end please. Just add this at the start of the ready method. // if cloning a page, then set the name to match the title so Protect Initial Differences works $this->wire()->addHookAfter("Pages::cloned", function($event) { $p = $event->arguments(1); $p->setAndSave('name', $this->wire('sanitizer')->pageName($p->title, Sanitizer::translate)); }); This approach also works when the copy button allows one step ajax cloning. I'll look into your sync button idea as well.
-
1) That was just to get you going - I'll make the change but I was hoping to hear back about LRP to see if I could fix that for you at the same time before committing a new version. 2) Because I don't have LRP I can't test with it to figure out why it's not working, but if someone who does have it can figure out the issue and provide a fix I'd be happy to include it.
-
Hi @Marty Walker - hope you're well! I think perhaps you don't quite have things right, but I am really guessing at this point. Keep in mind that if you want to embed into the site you need a dedicated template as defined in the settings and you shouldn't need the if($page->protected) check. Does that help at all, or am I missing the point entirely?
-
Hi @LAPS - I just tested here and even though currently it's not possible to select the user template, if you don't select any, the module does work on the user template. BTW - it would be trivial for me to allow selecting the user template - for now you can enable by changing line #736 to: if($currtemplate->name != 'user' && ($currtemplate->flags & Template::flagSystem)) continue; I don't have access to LoginRegisterPro so I am not sure about that but the module does work with uploads via the API so I would have thought it worked. Does the "Rename on Save" option help?
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
adrian replied to Nico Knoll's topic in Modules/Plugins
Not sure what version you are running, but those line numbers don't seem to match nico or my version. -
I haven't played with htmlx much yet, but maybe @kongondo has come across this? Maybe a screenshot of how it falls apart might also be useful. At this stage I don't know if it's something in my module vs the Tracy core that is causing the problem.
-
I'm not certain, but I feel like this might be necessary: https://stackoverflow.com/a/27061620/1524576
-
That could be built into Tracy if you want it. Currently the email logging is just all error levels to all listed email addresses, but I am sure we could support different levels per email. Up to you of course but it just feels like a good fit to me. Excited to see what you do either way.
-
Hi @gebeer - the Tracy core handles this via PHP's set_error_handler (https://github.com/nette/tracy/blob/f9645299229878a61b46baa82ff61d8a739bccf8/src/Tracy/Debugger/Debugger.php#L226) Looking at what your trying to do here, can I suggest that you extend Tracy rather than creating a new module. Recently I added the ability for Tracy to log to Slack (https://github.com/adrianbj/TracyDebugger/blob/3185ec827c001c0c310cb9b13558ca3e53eabbc5/includes/SlackLogger.php) and use different icons based on the error level, eg: so you should certainly be able to do something similar for Rollbar. I feel like most PW users make use of Tracy and this would just help to make it better without needing a separate module. You might find some further inspiration in the panels that add support for monolog that you can find here: https://componette.org/search/tracy You might find this useful: https://tracy.nette.org/en/recipes#toc-custom-logger although keep in mind that I had issues with that approach in that I couldn't get it to also support emailing errors at the same time Let me know if you have any other questions.
-
New version pushed with this.
-
What about in the Template Info section? Both when viewing the page and also when viewing the template?
-
But pageClass doesn't work on pages. I see you're calling it on $template though. So I think we want to populate "class" on both the page and template info sections which required different approaches. Please try the attached and let me if you're getting what you need in the Page Info and Template Info sections. RequestInfoPanel.php
-
-
Tracy has a File Editor panel. It doesn't currently have the option to create new files, but it's certainly a possibility. That said, I do tend to think of these tools as more for emergency use than regular development which is why I haven't previously thought of needing the ability to create files.
-
Thanks @Robin S for the report and fix. It's in the latest version.
-
What is and how to set the 'Editor protocol handler' for NetBeans?
adrian replied to LAPS's topic in Tracy Debugger
Sorry @LAPS I am not sure what to suggest - maybe there is a Netbeans forum or maybe StackOverflow where you could ask about it? -
What is and how to set the 'Editor protocol handler' for NetBeans?
adrian replied to LAPS's topic in Tracy Debugger
Maybe something useful in one of these? They aren't Netbeans specific but seem to explain how to configure custom ones. https://superuser.com/questions/548119/how-do-i-configure-custom-url-handlers-on-os-x https://stackoverflow.com/questions/471581/how-to-map-a-custom-protocol-to-an-application-on-the-mac or maybe you could use this as a starting point to write one for Netbeans? https://github.com/inopinatus/sublime_url -
What is and how to set the 'Editor protocol handler' for NetBeans?
adrian replied to LAPS's topic in Tracy Debugger
@LAPS - it looks like it should be: netbeans://open?file=%file&line=%line I am basing that on this project for Linux: https://tracy.nette.org/en/open-files-in-ide -
Hi @virtualgadjo - it's only one language at a time IIRC. The problem with multiple is how to arrange the data in the export. Different users will need different layouts so it's best to generate these sorts of exports yourself. I tend to use AdminActions to create these sorts of custom imports.
-
No processire functions working outside processwire templates directory
adrian replied to BigRed's topic in General Support
You might find this a better approach: https://processwire.com/blog/posts/pw-3.0.173/ -
Weekly update – 12 November 2021: Page Autosave + Live Preview
adrian replied to ryan's topic in News & Announcements
Maybe - I was using fpm with 8.1 -
Weekly update – 12 November 2021: Page Autosave + Live Preview
adrian replied to ryan's topic in News & Announcements
Interesting. I am pretty sure I was testing this feature on my local dev which was running 8.1 at the time, but great to hear it's now working for you regardless. I no longer have access to the dev tools support board so I can't test the latest version of the module - maybe there were multiple issues? -
findOne()