-
Posts
11,254 -
Joined
-
Last visited
-
Days Won
374
Everything posted by adrian
-
PW 3.0.172 – Find faster and more efficiently
adrian replied to ryan's topic in News & Announcements
@ryan - I just discovered that findRaw() won't return the "url" field. I suppose that is to be expected given that it's not a DB stored field, but rather calculated at runtime, but it does still somewhat limit the functionality of findRaw in LOTS of useful situations. Do you think it would make sense to support this, or would it just slows things down too much? The other thing is I am wondering if you'd consider an option to return a standard PHP object rather than an array? It would make it so much easier to switch between find() and findRaw() Thanks. -
And it would be great if @David Karich could update Page Hit Counter to use it.
-
Just a tip - I replaced the "Page fields to search" setting in the PW core Page Search (ProcessPageSearch) module to use the search_index field. It seems like a great alternative when you want to have the admin live search find pages based on the content of lots of fields (not just title etc).
-
Exception when using bd on a module extending Wire directly
adrian replied to MoritzLost's topic in Tracy Debugger
Hi @MoritzLost - I assume you are using PHP8? This used to be OK on PHP7, but 8 seems to have become more strict about blank vs zero. It should be fixed in the latest version. -
@jon9china - I have tried your step by step and can't reproduce the error yet. I am wondering what version of PW you are running? There was a very long-standing circular reference bug in the PW core related to page reference fields that was fixed here: https://github.com/processwire/processwire/commit/8dbff5c7bc367e805badf51204b4e31123cf9b6e - so basically you need to be running at least 3.0.166 to have that fix in place. Please let me know the version and if it is later than that, then I'll investigate this issue further.
-
@jon9china - thanks for the explanation. I think I sort of understand "They were looking for the page that identified the restricted user that was logged in", but if you could provide the selector code you are using it would be helpful - perhaps I can implement something into the ARB module so that you can still use the selector the way you want, rather than changing to the email field. So if you could post the old and new versions, I'll try to replicate and see if I can fix it somehow.
-
Hi @aComAdi - sorry about the problem with Tracy. You know, this is one of those strange things I have seen with Tracey on and off over the years. I actually just came across it again today, for the first time in a long time and @Robin S just PM'd me about it as well. In his case, it was the Field List & Values section in the RequestInfo panel, which once disabled fixed it for him. For me it's when an image called on the frontend is not available. The weird thing I've noticed in the past is if I load all Tracy panels, then the problem goes away. I'd like to finally get this sorted out though. I thought I was the only one ever seeing it ? I'll try to take another look soon, but I'd like to know if disabling the Field List & Values section fixes it for you, or if it is related to a missing image. Thanks for your help in narrowing this down.
-
@jon9china - sorry you're having problems with the module. You could please clarify what you mean by "the user restricted branch setting" ? Are you talking about the "User Specified Branch Parent" option for the "How to match user to branch" setting? Do you have the same problem if you use one of the option ways to match the branch? I can't replicate the problem here, so I am wondering if you might have some other additional hooks (custom or in a 3rd party module) that are also controlling access. It sounds like you are running out of memory due to an infinite loop. If you can narrow it down to some other code interaction that will help. If it's not that, would you mind trying to debug this module to see where it might be goin awry? Could you also post your other settings for the module? Also, is the error only when viewing the admin with a restricted user?
-
Thanks @teppo - hooking into Renderer::renderResult worked great! Gotta say, this is a really well thought out, and well coded module. Cheers!
-
Hi again @teppo - I am looking to include an image for each result. The key thing is that I want to show a thumbnail version so I want to be able to call PW's size() method on the image object, rather than simply using {item.images.first.url} I think there are probably a few different ways to accomplish this - maybe by doing a str/preg_replace on the rendered results, or maybe hooking into one of the render() methods within your module, or perhaps doing a completely custom rendering of results, although I am currently not sure how to show the _auto_desc when doing a custom render. Is there a trick for this? Otherwise, I wonder if this is something you think might be a good feature to include so it's easier to do this via the standard renderResults() method? Thanks for your thoughts / ideas.
-
HI @Matthieu - I've just added support for the MapMarker field type. Please update and let me know if you find any problems.
-
Hi @teppo - I've noticed a few issues with apostrophes when searching. The first issue is perhaps not something to can easily fix if you rely on PW selectors to do the search, but it is a shame that omitting an apostrophe from the search term results in no matches. The second is more fixable - notice how the results don't include the _auto_desc when you enter a search term with an apostrophe. The second screenshot shows the same returned results, but this time I searched for the phrase without the word with the apostrophe and the _auto_desc is included as expected. The final thing I noticed is that when the search term has an apostrophe, input->get->q ends up being empty. I was using it to populate the search input field so the user gets the results page with the search populated with the phrase they just searched for. Thanks.
-
Hi @shadowkyogre - looks like you would need that logic, but you'd also need to add the TFA field to the login form. Unfortunately I don't have time to look into this at the moment, but if you can get it working and provide a PR, I'd be grateful.
-
Not sure if something changed at some point, but I thought the column used to expand automatically when opening elements, but for now you can still make the entire panel wider with the drag handle at the bottom right which seems to do enough.
-
Safari / Ckeditor / Image bug - help to confirm please!
adrian replied to adrian's topic in General Support
Issue with screencast posted: https://github.com/processwire/processwire-issues/issues/1335 -
Of course - that works perfectly, thank you!
-
@Robin S - I am trying to offer selection of an uploaded file and not sure if I am taking the most efficient approach, but either way, it's not quite working. I am using https://processwire.com/modules/fieldtype-select-file/ to give me a InputfieldSelectFile $wire->addHookAfter('HannaCodeDialog::buildForm', function(HookEvent $event) { // The Hanna tag that is being opened in the dialog $tag_name = $event->arguments(0); // Other arguments if you need them /* @var Page $edited_page */ $edited_page = $event->arguments(1); // The page open in Page Edit $current_attributes = $event->arguments(2); // The current attribute values $default_attributes = $event->arguments(3); // The default attribute values // The form rendered in the dialog /* @var InputfieldForm $form */ $form = $event->return; if($tag_name === 'audio') { $modules = $event->wire('modules'); /* @var InputfieldSelect $f */ $f = $modules->InputfieldSelectFile; $f->name = 'selected_file'; $f->id = 'selected_file'; $f->label = 'Select File'; $f->folderPath = 'assets/files/'.$edited_page->id.'/'; $form->add($f); } }); All looks good so far, but then I end up with: Any ideas what I might be doing wrong, or if there is a better way? FYI, I had to change the root path in that File Select module to start at /site/ instead of /site/templates/ Thanks for any thoughts!
-
PW 3.0.172 – Find faster and more efficiently
adrian replied to ryan's topic in News & Announcements
@ryan - what do you think about having a referencesRaw() page method. If you're outputting a long list of pages referenced to another page, often all you need are the title and url field values. As an example, I am outputting a list of publications for a staff member. I believe this would really speed things up. Thanks for considering. -
Hi everyone, I had a client notice something weird and I can reproduce it as well. Using Safari (on a Mac - not sure about Windows), create content in a CkEditor field with an image before any other content. When inserting you must check the "caption" checkbox so that PW will wrap it in a <figure> tag. Now add some text below the image. Now, select that image and click the Image button the CkEditor toolbar (or right click on it and select image properties). You can make a change if you want, but even clicking "Insert Image" without changes will work. Do that, and you'll see that all content below the image is gone. If you add a sentence before the image, you'll see that the problem no longer exists. I'm not sure yet if this is a PW bug, or a CkEditor bug. Thanks for any help in confirming this and any thoughts of what is to blame ?
-
Page urls with auto-incrementing IDs (and without Page Name parts)
adrian replied to SwimToWin's topic in Wishlist & Roadmap
Or another approach if you don't want to actually change the name: https://processwire.com/modules/process-redirect-ids/ -
E_CORE_WARNING: Module 'sqlite3' already loaded on line: 0 in Unknown
adrian replied to bbeer's topic in Tracy Debugger
Hi @bbeer - sounds like you have duplicate entries for sqlite3.so in your php.ini file. -
@Arcturus - I think you should be using the dev branch - I believe that the 2.0 branch is obsolete. @teppo ?
-
Make sure you limit it to the PageEditor interface in the admin - you don't want that checkbox appended everywhere back and frontend ?
-
@szabesz - maybe it's because I have my trackpad sensitivity / speed quite slow, but I struggle to actually reproduce what you see. Perhaps I could remove the Tracy core eventListener for moving the bar. I disabled moving it another way quite a long time ago - it was causing all sorts of other problems IMO and didn't add any significant benefits.