Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/25/2025 in Posts

  1. ProcessWire 3.0.251 has several updates to the AdminThemeUikit default theme by Konkat, a page-finding selector bug fix, and more. This version should fix the majority of reported issues with the new default theme in AdminThemeUikit, as well as cover the scope of Uikit features much more broadly. As we get closer to our next main/master version, we appreciate your help testing it. This version converts to “—pw” namespaced CSS variables. Previously variables were named like "—main-color" (no namespace prefix) and now they all have a "—pw" prefix, i.e. "—pw-main-color". Make note of that if you are using any custom CSS with the default theme by Konkat, as you may need to update your CSS variable names. This version also adds 3 new toggles (available in the AdminThemeUikit module settings). These toggles enable you to customize specific parts of the theme to be more similar to or consistent with the Original theme. They are intended to answer common feature requests for the theme. If you think any of these should be enabled by default, please let us know. Currently they require you to enable them in the module settings. These toggles include: Use bold headers for repeaters, files, images, etc. - This uses the selected “main color” as the background color of repeatable and sortable item headers, which results a treatment that’s heavier and more similar to the Original theme. Use buttons for page list actions - These makes the theme use page list action buttons that resemble those in the Original theme. It also slightly modifies the appearance of pagination links. Highlight focused inputs - This makes the color of an input change (to white or black) when it is the focused input. It makes select and text inputs have the same color presentation. And it makes TinyMCE have a white (or black) background when focused, rather than a muted background. In addition to the above, today’s version also adds version query strings to the CSS/JS files used by the Konkat default theme. Previously it didn’t, which due to browser caching could have caused some to see the incorrect output of the theme. ProcessWire 3.0.251 also fixes a bug with word matching operators that query the database, like those you might use in a $pages->find() selector. (Word matching operators are those with a “~” in them). If you attempted to match a word that was more than 80 characters long, it would cause the word to get filtered out of the query completely, rather than force a non-match. So if your selector was “a=b, c=d, e~=[81 character word]”, then it would behave the same as a “a=b, c=d” selector, with the “e” part no longer contributing to the result. The correct result here is to match 0 pages, but it would instead match public pages that matched selector “a=b, c=d”. It was corrected by truncating the long word to 80 characters, rather than removing it from the query. If you are using full-word matching operators in your site search engines, it’s worth throwing some 81+ character words at them just to see if it causes any issues with your results, perhaps matching incorrect, irrelevant or too many pages. If so, then you may want to upgrade to PW 3.0.251, or truncate your search text to 80 characters before putting it into the selector. i.e. $q = substr($q, 0, 80); Thanks to @adrian for finding and reporting the issue. Lastly, ProcessWire 3.0.251 contains a few other updates, such as the ability for Process modules to use icons in their headlines, a ProcessPageLister fix, and more. ProcessWire Weekly #584 covers a couple of them in more detail. That’s all for this week, thanks for reading and have a great weekend!
    7 points
  2. I can’t believe ProcessWire Weekly is still going strong! Its 10 year anniversary was actually in May last year.
    4 points
  3. Hi everyone, I encountered the same issues with the ImageSizerEngineAnimatedGif and PHP 8 compatibility. The issues that prevented animated GIFs from being processed correctly. The module works fine under PHP 7 but fails under PHP 8 due to changes in how GD handles image resources. Issues Encountered GD Resource vs GdImage Object: PHP 8 changed GD image handling from resources to GdImage objects Array access on null values: Stricter type checking in PHP 8 caused "trying to access array offset on null" warnings File handling: Issues with fopen/fwrite combinations Complete Fix Applied Here are the changes to make the module PHP 8 compatible Add new helper method (after line 42) <?php /** * Helper method to check if a variable is a valid GD image resource/object * Compatible with both PHP 7 (resource) and PHP 8 (GdImage object) * * @param mixed $image * @return bool */ protected function isGdImage($image) { // PHP 8.0+ uses GdImage objects instead of resources if (class_exists('GdImage') && $image instanceof \GdImage) { return true; } // PHP 7.x uses resources return is_resource($image) && get_resource_type($image) === 'gd'; } Update module version (line 26) <?php 'version' => 2, // Increased for PHP 8 compatibility Replace all GD resource checks Line 176: if(!is_resource($frame)) → if(!$this->isGdImage($frame)) Line 178: if(!is_resource($bg)) → if(!$this->isGdImage($bg)) Line 205: if(!is_resource($nf)) → if(!$this->isGdImage($nf)) Line 234: if(isset($bg) && is_resource($bg)) → if(isset($bg) && $this->isGdImage($bg)) Line 235: if(isset($frame) && is_resource($frame)) → if(isset($frame) && $this->isGdImage($frame)) Line 236: if(isset($newimg) && is_resource($newimg)) → if(isset($newimg) && $this->isGdImage($newimg)) Line 271: if(!is_resource($frame)) → if(!$this->isGdImage($frame)) Line 275: if(is_resource($bg)) → if($this->isGdImage($bg)) Line 287: if(!is_resource($bg)) → if(!$this->isGdImage($bg)) Line 302: if(!is_resource($frame)) → if(!$this->isGdImage($frame)) Line 306: if(is_resource($bg)) → if($this->isGdImage($bg)) Line 318: if(!is_resource($bg)) → if(!$this->isGdImage($bg)) Line 335: if(!is_resource($nf)) → if(!$this->isGdImage($nf)) (This was the critical fix!) Line 361: if(isset($bg) && is_resource($bg)) → if(isset($bg) && $this->isGdImage($bg)) Line 362: if(isset($frame) && is_resource($frame)) → if(isset($frame) && $this->isGdImage($frame)) Line 363: if(isset($newimg) && is_resource($newimg)) → if(isset($newimg) && $this->isGdImage($newimg)) Improve file handling (lines 223-225 and 348-350) Replace: <?php $result = false === fwrite(fopen($srcFilename, 'wb'), $gifmerge->GetAnimation()) ? false : true; width: <?php $handle = fopen($srcFilename, 'wb'); $result = $handle && fwrite($handle, $gifmerge->GetAnimation()) !== false; if($handle) fclose($handle); frame validation (around line 340): <?php if(count($frames) > 0) { $gifmerge = new ISEAG_GIFEncoder( // ... existing code ); // ... file writing code } else { $result = false; } The main issue was on line 335 where if(!is_resource($nf)) prevented PHP 8's GdImage objects from being recognized as valid frames. An empty frame arrays was passed to the GIF encoder, causing the errors in gif_encoder.php. Hope this helps others who might encounter the same issues!
    2 points
  4. You can apply any SQL you want by hooking into the PageFinder: $wire->addHookAfter("PageFinder::getQuery", function (HookEvent $event) { // get the DatabaseQuerySelect object $query = $event->return; // dump the object to tracy // https://i.imgur.com/BdDEQU3.png bdb($query); // modify the query to only find pages with name length < 5 $query->where("LENGTH(pages.name)<5"); // remove the hook after first execution $event->removeHook(null); }); bd($pages->find("id>0")); The idea is to add the hook directly above your $pages->find() call and inside the hook you remove it so that it does not apply to any other $pages->find() operations that might occur later. This is a DatabaseQuerySelect object: And with that object you can add any custom ->where() or ->join() or whatever you need.
    2 points
  5. Understand, guess that I'm missing your use case scenario. Above code was meant just to "custom sort" results that you can limit and get with a pw regular find() selector, definitely not for sorting all pages.
    1 point
  6. Ah, thank you, but I cannot load all the pages into memory - there's thousands, so this would be inefficient in this instance.
    1 point
  7. Hi @vincent sorry but clicking on your link leads me to a 404... and if i try and see the pull request tab, there's no pull request to see all i can see if following the link github just sent me https://github.com/v-maillard/pw-lang-fr/commit/0f5c58ab0133c466f57dd00d5035524089902a69 and i can't see other modification than the ones from my files, sorry to still be such a github dumb noob, not my thing... 😄 Just a word to say that in general what I do is delete all the unused files (empty or containing only abandoned phrases) for the given version I don't keep all the translations history but only the files with the sentences to be translated for the latest version and only for core translations. on the other hand, I've left all the translations of the master versions on github since I started putting them there. i'm slowly working on some other files, some pw non "native" modules i use a lot and, if despite my age, I survive the heatwaves 😄 , will probably create a repo for those files as separate json in folders named after the module name and version folder have a nice day
    1 point
  8. Hello everyone, @Christophe Thanks for your pull request, I've integrated it. The zip file for the latest version (3.0.246) is available here: https://github.com/v-maillard/pw-lang-fr/releases/tag/v3.0.246. @virtualgadjo If you can integrate these files into your work or else make pull requests, that would be great, because otherwise you will be deleting Christophe's commit. Have a nice day, Vincent
    1 point
  9. // get current mail body $html = $mail->get('bodyHTML'); if (!$html) $html = nl2br($mail->get('body')); // <--------- add this line if (!$html) return;
    1 point
  10. Maybe not useful for everyone, but I find I am often searching for content via Adminer and when the results are from a repeater item page, I need to figure out which is its "forPage". I have just added a new forPage row to the PageInfo section of the RequestInfo panel that lets you view or edit directly from here making things much easier.
    1 point
  11. In your page reference field’s settings under Input -> Selectable Pages -> Parent, you can select /admin/access/users. If you don’t specify anything else, that should make all users available for selection. You can of course narrow it down more by using the other settings. I’m sure you’re aware that ProcessWire keeps track of which User created an Article page anyway. It may be a viable option for you to just use that (if the default behaviour doesn’t work for you, override $page->createdUser in a hook or enable editing the user through the advanced template options). Using the built-in user field should improve performance since it’s part of a Page’s basic data, not a regular field, and it may be more idiomatic, depending on what exactly you’re doing.
    1 point
  12. ProcessWire: processwire-master_3.0.229 (and earlier versions) TextformatterAccordion: TextformatterAccordion-master_1.1.1 used inside InputfieldCKEditor First issue (solved): When using the originally downloaded TextformatterAccordion (v.1.1.1), I experienced a message on top of the outputted page: Notice: Array to string conversion in E:\UniServerZ\www\processwire-master\site\assets\cache\FileCompiler\site\modules\TextformatterAccordion\TextformatterAccordion.module on line 59 The line 59 is: if(empty($$accordion[0])) array_shift($accordion); I recognized a doubled '$$' before the variable 'accordion[0]', which is an operator known as "variable of variable"; but in my system I've debugged it, and it isn't a "variable of variable", it's only an array item containing text. After I removed one of the '$' operators, the line 59 changed into: if(empty($accordion[0])) array_shift($accordion); then the 'Notice' (see above) disappears and Accordion is working well :-). Second issue (solved): When there are several paragraphs in front of the Accordion part, is happens (regulary), that the last - neutral - paragraph of them is seen as (first) Accordion-item and is formatted like: Untitled Item Lorem ipsum... After inserting an extra check at the beginning of the 'foreach'-loop (lines marked with "ESB") of ...\www\processwire-master\site\modules\TextformatterAccordion\TextformatterAccordion.module ... foreach($accordion as $k => $v) { $pos = strpos($v, "~~~\t"); if ($pos === false){ // no accordion items in this block // ESB continue; // ESB } // ESB $title = trim(substr($v, 0, $pos)); ... , also this part of Accordion is working well. I hope, my tips are helping other users of TextformatterAccordion.
    1 point
×
×
  • Create New...