Jump to content

Sanyaissues

Members
  • Posts

    76
  • Joined

  • Last visited

Everything posted by Sanyaissues

  1. Hi @bernhard. I'm about to try rockmigrations, I already saw your videos (amazing job, thank you!), poke the docs and read a few posts on this thread. But there's something I'm wondering: Let's say we have a clean PW installation and we want to create a page (dar) with the template (doo) and two fields (foo & bar). What "workflow" will you follow to deploy them? My first guess: 1. On migrate.php we create the page, template and fields: 2. We create /site/classes/DooPage.php to define the settings for the doo template: - Is that approach Ok? Any tips? - After the page, template and fields were created, it's Ok to leave the "creation" instructions on migrate.php? Any risk of conflict with the instructions on DooPage (in my example I defined different titles for the foo and bar fields)? - How can I see the RM methods using the vscode snippets? Thanks.
  2. Cool, add any updates here. But it looks like a permission issue with your /site/assets folder. Try: chmod -R og+rw /site/assets Or maybe you can restore the files and folders manually by going to drive.google.com and download the folder contents. Don't know how the sync works, but maybe your local files permissions are "screwed" but the files in the cloud version are Ok. Here's a related discussion you can read.
  3. Hi @François Lacruche, I assume you are running a website on your computer and when you synced the folder to Google Drive, the permissions of the folders/files got "corrupted". - Where are you seeing the "destinationPath is not writable" error? Please share a capture. - Is the site accessible? - Can you access the admin? Some possible solutions (just guessing here): - Try to set the permissions for the folders/files https://processwire.com/docs/security/file-permissions/#how-to-change-permissions-of-existing-files - What if you do a new Processwire installation in a new folder and after the installation is done, you copy the files inside the "corrupted: /site/ folder to the new installation?
  4. Hi @SIERRA The problem isn't related to putting the content inside Processwire templates folders or how you implemented the paidhai template. The paidhai template requires 417kb only for the CSS (plus 100kb of not used javascript) when loading the website. That's a lot. The solution is to deliver only what is required (css, images, scripts) and defer everything else. To understand what is really required on the first load you can use the coverage tool in Chromes dev tools: 1. Open the chrome dev tools (Shift + Ctrl + I) 2. Open the command menu (Shift + Ctrl + P) 3. Type coverage and select the show coverage tool Coverage can help you to understand which content was loaded but is not being used (aka: things that you can defer). As you can see in the picture, 567kb are being loaded, but only 67kb were needed to render the first content. I never used Bootstrap before, but in your case I will probably try to understand what CSS & JS content is really needed. - Does your website really require all the CSS files on first loading (popup, carousel modal-video, font-awesome)? - Can you defer or async the main.js and jquery.js files? or move them to the bottom of the <body>? - Can you bundle some Bootstrap files to decrease the number of requests? To solve it you can do what @AndZyk told you. Use Critical to extract, minify and inline the critical css, and then use preload to load all the other CSS files. Also, maybe Optimize can solve the issue for you.
  5. ProcessWire > 3.0.33 ? PHP >= 7.2.0 ? It's working @netcarver. Glad you got it. Thanks.
  6. Hi @netcarver,I'm running PW 3.0.240 here. When I was testing the 'requires'=> ['ProcessWire>3.0.33', $php_version] fix, I noticed that if I search the module from the directory, the error appears But if I try to install by using any of the other options: module from URL (https://github.com/netcarver/WireMailPostmark/archive/main.zip), from upload or manually the value renders without problem: ProcessWire>3.0.33, PHP>=7.2.0 (Before each test I deleted the module folder, clear the compiled files, hit the refresh module button, etc..)
  7. Hi @netcarver,I was testing some WireMail integrations and it wasn't possible to install WiremailPostmark: Requires ProcessWire > 3.0.33 PHP 8.1.212.17 >= .selfMIN_PHP Thanks.
  8. The error persist @FireWire Update 1: I created a new template that only renders the form (loaded with Markup Regions), and it is working. However, in another template with a repeater field that I render with <?= page()->render('banners') ?>, I see the error above. The repeater isn't related to the form, but there is something in the way I'm rendering the content inside my repeater that is breaking FBhtmx. I will try to find out why the error occurs and keep you updated. Update 2: I found the issue! Imagine a template with a Page Reference field, where the value is a PageArray allowing users to select multiple values. The field is rendered using <?= page()->render('myField') ?> and the field template is: // /site/templates/fields/myfield.php <?php namespace ProcessWire; foreach($value as $item){ echo $item->render(); } ?> When our page with the form and myField is rendered, the hook after Page::render will be executed for each value of myField as well as for the page itself. If $this->renderHtmxResponse($e->return) is executed with the pages of myField, a null value will be returned. My temporal fix: private function addPostFormProcessingHook(): void { $this->wire->addHookAfter( 'Page::render', fn ($e) => !empty($e->return) && ( $this->isHtmxRequest() && $e->return = $this->renderHtmxResponse($e->return) ) ); } private function renderHtmxResponse(string $renderedPageMarkup): string { $pattern = "/\n?<div id=[\"']{$this->htmxFormId()}[\"']((.|\n|\r|\t)*)(<!--\/.FormBuilder-->|<span data-formbuilder-htmx-end><\/span>)/U"; preg_match($pattern, $renderedPageMarkup, $matches); return $matches[0] ?? ''; }
  9. Excuse my english! What I mean, was: the form WORKS using markup regions with $form->render AND also, the form works using FormBuilderHtmx in a regular template. @FireWire
  10. @FireWire using $forms->render with Markup Regions or using FormBuilderHtmx, without the markup regions, everything works. Regarding my template with the markup regions the setup is kind of simple: Question aside: It's possible to return to htmx only the form using if($config->ajax) or something else?
  11. @FireWire if the form is rendered inside a template using Markup regions, there's an error after submission: TypeError ProcessWire\FormBuilderHtmx::renderHtmxResponse(): Return value must be of type string, null returned search► File: .../modules/FormBuilderHtmx/FormBuilderHtmx.module.php:169 159: /** 160: * Finds the form that has been submitted and extracts the markup to return what HTMX expects 161: * @param string $renderedPageMarkup Rendered full page markup 162: */ 163: private function renderHtmxResponse(string $renderedPageMarkup): string 164: { 165: $pattern = "/<div id=[\"']{$this->htmxFormId()}[\"']((.|\n|\r|\t)*)<!--\/.FormBuilder-->/U"; 166: 167: preg_match($pattern, $renderedPageMarkup, $matches); 168: 169: return $matches[0]; 170: } 171: }
  12. That was fast @FireWire, You are on fire! Now my form is returning the Success Message and not the whole page. THANKS. I'll keep testing.
  13. Hi! @FireWire! I'm using both FormBuilderHtmx and FieldtypeFormSelect, so Thank you! When I Submit a form with FormBuilderHtmx, the div where the form is, loads the whole page with the success message, and not only the success message as I was expecting. Form before submission: Form after submission: This is how I'm rendering the form: <?= $htmxForms->render(page()->form_selector, [], '#indicator') ?> <div id="indicator" class="activity-indicator"> <span class="loader"></span> </div> Do you have any clue why FormBuilderHtmx isn't extracting the content HTMX expects and is returning the full markup? Thanks
  14. Hi! I can help you, and I have time on my hands. Drop me a private message with your email.
  15. Leaving this update here, for the future:
  16. Nice! I love it. Today, while working with JSON stored in Page fields, I received the newsletter containing a link to your module. I instantly felt that it was perfect for replacing my json_decode calls. Just out of curiosity, what do you typically do when you need to retrieve a value, modify it and save the value again in the field? I was doing: $page->of(false); $json = json_decode($page->jsonfield, false); $merge = array_merge($json, $otherJson); //$otherJson is a json I want to push to the field $json = json_encode($merge); $page>save(); I'm trying to understand how to get the field with the textFormatter in that situation, because if I call page->of(false) before retrieving the value, obviously the value came as a string, but If I set page->of(false) after retrieving the value, the value is not saved. $json = $page->jsonfield; $page->of(false); $merge = array_merge($json, $otherJson); //$otherJson is a json I want to push to the field $json = json_encode($merge); $page>save(); //Isn't saving
  17. @Ivan Gretsky that's genius! Thanks.
  18. I love the design!! Although the size of the elements in general, could be a little bit bigger. Nice work @benbyf ❤️
  19. Thanks all for the compliments! @horst Actually, I didn't add any values for defaultGamma, sharpenning, etc... I just set the quality to 90 in the $config->webpOptions. $config->imageSizerOptions('webpAdd', true); $config->useWebP = true; $config->webpOptions = array( 'quality' => 90, 'useSrcExt' => false, 'useSrcUrlOnSize' => true, 'useSrcUrlOnFail' => true ); Thanks for the tip to protect the original images.
  20. I hadn't developed a website for a while, but here we are. It's a very simple minimalist website to showcase the latest work of Dominican Artist Patricia Abreu Mota. Site: https://patriabreu.com Modules: Procache ❤️ Seo Maestro Profiler Pro Lister Pro ProcessRedirects
  21. Edit: Forget it. The error disappear. Hi Does anybody understand why this error? SeoMaestro 0.8.0 / PW 3.0.135 Fatal error: Method SeoMaestro\PageFieldValue::__toString() must not throw an exception, caught ErrorException: chdir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/xxxxxx.com/:/tmp/) in /var/www/vhosts/grupopages.com/sites/xxxxxxx.com/wire/core/WireDebugInfo.php on line 0
  22. Try http://kartograph.org/
  23. Hi @adrian! I'm using your code to prevent some custom hooks to break things in the back-end. Did you find any case where the code fails? $wire->addHookBefore('InputfieldForm::render', function($event) { if( wire("process") != 'ProcessPageView' ) return; //Prevents classes from being added to the fields in the backend $form = $event->object; $form->addClass('uk-form'); });
  24. Hi, I have a page with a repeater called teams with two fields: team (a pageReference with a list of teams) and people (a pageReference with a list of people who likes this team). I'm trying to populate the people field in the repeater according to the value of the team field in the same repeater. So far. I'm able to get the pageArray that I want to assign to the people field, but i don't know how to "save" the value for each instance of the repeater. I hope somebody can give me a light. Thanks in advance. $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->hasField == 'people') { $repeaterField = $event->arguments('page')->teams; foreach ($repeaterField as $t) { // Is this the way to loop the instances of the repeater? $team = $t->team->id; $t->people = $event->pages->find("template=user, team={$team}"); var_dump($t->people); // This returns the values that i want to assign for each repeate instance $event->return = $t->people; // I hope this assign a custom pageArray for each repeater, but it assigns the same for all the instances of the repeater } } });
×
×
  • Create New...