Jump to content

Sanyaissues

Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by Sanyaissues

  1. ProcessWire > 3.0.33 👍 PHP >= 7.2.0 👍 It's working @netcarver. Glad you got it. Thanks.
  2. 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..)
  3. 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.
  4. 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] ?? ''; }
  5. 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
  6. @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?
  7. @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: }
  8. 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.
  9. 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
  10. Hi! I can help you, and I have time on my hands. Drop me a private message with your email.
  11. Leaving this update here, for the future:
  12. 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
  13. @Ivan Gretsky that's genius! Thanks.
  14. I love the design!! Although the size of the elements in general, could be a little bit bigger. Nice work @benbyf ❤️
  15. 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.
  16. 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
  17. 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
  18. Try http://kartograph.org/
  19. 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'); });
  20. 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 } } });
  21. Update: The render behavior of the profile is correct. My mistake was to use TextLanguage in the fields when i just need the user to see labels according of his language (that can be achieved with the text field type). Hi, I'm using LoginRegister to allow users to edit their users profiles in the front-end, and some of the user fields are type TextLanguage (to allow multiple languages). The problem is that when I render the Profile Edit, the inputfields shows in all the installed languages. That doesn't happen when I render the login or register forms. How can i prevent that the TextLanguage inputfields render in both languages? My code <?php $user->language = $languages->get("default"); $input->get->profile = 1; $profileForm = $modules->get('LoginRegister')->set('renderStyles', false)->execute(); ?> and later... <?= $profileForm ?> The output for an multilanguage inputfield: <div class="InputfieldContent "> <div class="LanguageSupport" id="langTab_Inputfield_profile_firstname" data-language="1029"> <label for="Inputfield_profile_firstname" class="LanguageSupportLabel detail">English</label> <input id="Inputfield_profile_firstname" class="InputfieldMaxWidth" name="profile_firstname" type="text" maxlength="2048"> </div> <div class="LanguageSupport" id="langTab_Inputfield_profile_firstname__1031" data-language="1031"> <label for="Inputfield_profile_firstname__1031" class="LanguageSupportLabel detail">Spanish</label> <input id="Inputfield_profile_firstname__1031" class="InputfieldMaxWidth" name="profile_firstname__1031" type="text" maxlength="2048"> </div> </div>
  22. After enable the Tags File Compiler module, echoing variables with brackets syntax doesn't work. I try something simple like {page.title} and is displayed like the tag isn't parsed: {page.title} This problem happens with PW 3.0.108, i have another installation with 3.0.82 and it works. Any Ideas? thanks.
  23. Hi, @flydev! Recaptcha v3 came out, would you mind taking a look?
×
×
  • Create New...