Jump to content

Juergen

Members
  • Posts

    1,221
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by Juergen

  1. This is very strange! I guess the only place for a problem could the form.php file in this case, because it contains all the code for the frontend.

    I have studied the differences between the code from version 2.1.46 and 2.1.47 from the Form.php file, but I have not found a line, where I think it could be the cause for this issue.

    Here you will see the differences between the 2 versions: https://github.com/juergenweb/FrontendForms/commit/c42a410c247dd04bb296a04d8e112dc8fbb7dc4b

    If you have time, please change only the code of the Form.php file from the current version (or the 2.1.47) version with the one of the 2.1.46 version. Leave all other files untouched. If it works, we could be for sure that the problem is really inside the Form.php and nothing else.

    I have tried to change the codes and I did not run into problems (current version of FrontendForms, but Form.php was from the 2.1.46 version).

    form-2.1.46.php

    You can use your own 2.1.46 file or you copy the code from this file.

    Please let me know if the problem still persists.

     

  2. I have taken a look into the changelog.md file of FrontendForms on Github and only 2 huge changes have been taken between 2.1.46 and the latest 2.1.54 version.

    2.1.47: Ajax support has been added

    2.1.50: New class for creating privacy text has been added

    All other changes are minor (but maybe could lead to problems too).

     

    16 minutes ago, donatas said:

    Can it be permission issue?

     

    I dont know, but as you have written, it only happens with the new version of FrontendForms. So the problem must be there (somewhere).

    First of all disable the embedding of the Javascript file. You can do this in the backend configuration inside the first tab, and see if it has an impact. I do not guess that it will solve the problem, but the Javascript file has been changed during the time too. If nothing happens, please enable the embedding of the JS file again.

    Next step:

    You are using a local machine, so could you install only for testing purposes the FrontendContact module, which is a simple contact form based on FrontendForms? It would be interesting what happens if you try to send a message with this module.

    You have to enter the email address where the mails should be sent to inside the module configuration and then you add the follwing code to one of your templates, where you want to output the contact form:

    echo $modules->get('FrontendContact')->render();

    Send a message and see what happens.

  3. Hello @donatas

    First of all, thank you for reporting this issue.

    Interesting! I do not have heard of this kind of error before, but Google says that this is a browser related problem and not a server problem. They say that this could be caused by browser extensions or the browser cache, but there are more issues that can be responsible for such a scenario.

    Could you please try to use another browser than the one that you are still using. It would be interesting if the problem persists. If the problem will be still there I can recommend you to deinstall and reinstall FrontendForms. I cannot reproduce the error and I cannot find out the cause only by the error message itself. Sometimes a fresh install helps to solve a problem.

    Corrected: Ok, I see you have tried this before.

    I guess this is not a general problem, because this is the first report of such a problem. Otherwise other users would have reported such an issue before.

    Best regards

  4. Sorry @Flashmaster82

    I guess I will not implement this on the FrontendForms module, but on the FrontendContact module. That was a misunderstanding. The FrontendForms module is only the base class for all others.

    If you need such a feature you can do it inside the isValid() method (creating a new page, sending mails and so on). That should not be a problem.

    if($form->isValid()){
    	// create the new page
    }

    Best regards

    • Like 1
  5. I have found the solution inside the FieldtypeComments.module from Ryan:

     * Unlike $pages->find(), pagination of comments is not automatically tied to 
    	 * $input->pageNum(). As a result, if you paginate, you should specify both 
    	 * “start=n” and “limit=n” in your selector:
    	 * 
    	 * ~~~~~~
    	 * $limit = 20;
    	 * $start = ($input->pageNum() - 1) * $limit; 

    So adding setStart()  and setLimit() method will solve the problem. I have only added setLimit() before.

    $commentPerPage = 20; // how much comments should be displayed
    $pageNum = wire('input')->pageNum();
    $start = ($pageNum - 1) * $commentPerPage;
    $allComments->setStart($start);

    Page 1:

    image.png.86badd42874e1a3975360a706b2059f3.png

    Page 2:

    image.png.55b5821c7b488bd03a5c3acc65abe60a.png

    • Like 2
  6. Hello @all

    I am struggeling for a while to get it working, but I do not succeed.

    Description:

    I have a PaginatedArray containing a lot of comments and therefore I have created a new custom page inside the admin which contains all the comments inside a AdminTable.

    Now I want to add a pagination below the table, to show only a certain amount of comments per page. To render the pagination I have included the following code:

    echo $allComments->renderPager(); // $allComments is the PaginatedArray

    This outputs the pager and the redirection to page1, page2 and so on works, but the active state of the pager button will always stay on the first button (the pager button number 1 has always the red background color, even if another page different from 1 is loaded).

    image.png.6334fe2f6c1a4899eab13c6afcab75d9.pngI am on the first page - everything ok

    image.png.7f492467c758ef107e307fc3c9dc85ce.pngI am on the second page, but number 1 is still active

    I have also tried to change the current page manually:

    $pager->setPageNum(2);

    Source: https://processwire.com/api/ref/markup-pager-nav/set-page-num/

    But this does not work too!

    Can someone show me a working example with pagination and a PaginatedArray?

    Thanks in advance!

     

  7. Thank you @Bernhard

    But unfortunately this doesn't work in my case if you have a FieldtypeMulti (or probably a Fieldtype as well) and the corresponding input field, even if autoload is set to true.
     
    When I add the ready() method, it doesn't take it into account - only the init() method. Maybe there is a difference between an ordinary module and a module of type Fieldtype.
     
    Maybe that could be the reason why Ryan didn't add the files via hook in his comment module either.

     

  8. Hello @all,

    I am struggeling to add a Fieldtype/Inputfield specific  JS and CSS file to the frontend. Just to be clear: I am talking about the frontend not the backend!

    From a module it is not a problem! In this case I can use a Hook on Page::render to add the files.

    $this->addHookAfter('Page::render', $this, 'addmyFiles');

    On a Fieldtype/Inputfield this does not work.

    Even @ryan uses to add the JS and CSS files of his Comments Fieldtype/Inputfield by hand to the frontend. Maybe it is not possible at all, but I want to know if other users probably have found a solution to achieve this.

    Best regards

  9. The first version of FrontendLoginRegister was released a long time ago, and the module in its latest version (2.1.8) is now available in the Processwire modules directory.

    After a long development period, I have decided to add this module to the modules' directory. This will make it much easier to update the module in the future, and I hope that a larger community will test the module and report problems.

    The module has BETA status. I have tested it and have not found any problems, so it should work as expected (but I probably cannot test all possible scenarios). Therefore, I would be happy if many people would test the module and help me to reach the stable status after a while.

    Best regards

    • Like 4
    • Thanks 1
  10. Just to mention: If you do not find the privacytext.php.json file, you have to add it first.

    Click at the top at the "Find Files To Translate" Button.

    1473777694_Screenshot2023-11-02at06-13-15Languagesdefaultwebseite6_at.thumb.png.ec7885151149599616a696c3f1cf3dfd.png

    Look at the first scroll-down field "Translatable files in /site/" inside the category "No translation files exist" and look for the file there. If you have found it, click on it and click the "Submit" button on the top right corner.

    766368888_Screenshot2023-11-02at06-16-32LanguageTranslatorProcessWirewebseite6_at.thumb.png.b06f29f2622f7796ecc01c72cbdd7a32.png

    Now you will find the file as written in the previous post.

     

  11. Hello @xweb

    It seems that you are new to ProcessWire 😉.

    Every text inside the module is translatable in the backend. This feature is called "translatable strings" in ProcessWire. No need to touch the sourcefile!

    All you need is to enable language support in the backend. You will find it under Modules/core:

    345469761_Screenshot2023-11-01at19-52-51ModulesProcessWirewebseite1_at.thumb.png.ad2ce4ad4d0060be9f268f4e2167777b.png

    After you have installed it, a new navigation item called "Languages" appear under Setup:

    languages.png.619d0ddc777df96bb430a218bdac790d.png

     

    After clicking this navigation point, you will be redirected to a page, that contains all installed languages. In your case it is the language "default". Click on it and you will be redirected to the translation page, where you can translate every translatable string of the whole installation.

    1750849829_Screenshot2023-11-01at20-04-26Languagesdefaultwebseite6_at.thumb.png.1a5c80ce945117ac15c31cdfc21ec27a.png

    The last step ist to find the file, where the text for the privacy could be translated. It is called privacytext.php.json.

    189279574_Screenshot2023-11-01at20-07-09Languagesdefaultwebseite6_at.thumb.png.abb24ee24f6e47305ff0fbf2b11c1976.png

    Click on edit and translate the text to your needs.

    1113987094_Screenshot2023-11-01at20-09-31LanguageTranslatorProcessWirewebseite6_at.png.8d9de707543c890b502d0b071d27aae3.png

    Thats all!!!!

    I recommend you to study the multilanguage feature of ProcessWire and how translatable strings work.

    Hope this helps! Best regards!!

     

  12. Version 1.0.2 is out now!

    This new version includes a new privacy feature: you can now not only decide whether or not to display an "Accept Privacy" checkbox - you can now choose to display a checkbox, a text-only version, or nothing at all.

    IMG_20231029_105650.jpg.26245339461ee0cac5b80dd06a2018f6.jpg

    The idea for this new feature comes from a request from @Chris-PW on the forum, who brought to my attention that a checkbox to accept privacy is no longer recommended and a simple text like "By submitting the form you agree to our privacy policy" is much more common nowadays.

    With the new feature, you can use the type of privacy notices you want.

    Before you update this module, you should first update FrontendForms to the latest version, because it contains new methods used by this module. Otherwise, ProcessWire will not let you install the new module version.

    After updating to the latest version, go to the module configuration, open the Privacy Field tab to make your settings, and save the module configuration.

    Go to the frontend and verify that the contact form displays correctly with the new settings.

    As always, make sure everything works as expected and please post any issues you encounter directly to GitHub.

    Have a nice Sunday!😀

     

  13. New Class "PrivacyText" added on version  2.1.50

    This is a new feature, that offers you to display a text only version (including a link if set) instead of a checkbox version for the "Accept our Terms and Privacy Policy". Thanks to @Chris-PW from the support forum for informing me, that a checkbox is no longer recommended, and a text would be the better option.

    Please read the changelog.md for full information about the new feature.

    Preview of text without link:

    1588500214_Screenshot2023-10-27at12-54-53Home.png.aa48e8e0948880a0e8127acd99b9e9ed.png

    Preview of text including a link to the privacy policy page if set inside the module configuration

    1748178837_Screenshot2023-10-27at12-57-04Home.png.3385a84aae68da46bb522de12e9b9d25.png

    Best regards

    • Like 1
  14. Hello @dynweb

    Thank you for reporting this issue and offering a solution!!

    You are right, there was a logical mistake inside the InputfieldPassword class. I have corrected this wrong behavior and updated the module to 2.1.49.

    You can read the complete changelog here: changelog.md

    Be aware, that the checkbox will be appended by default and you have to manually disable it by using the following method including false as parameter

    showPasswordToggle(false);

    Best regards

    • Like 1
  15. Version 1.2.5 is out!!

    This version now supports Ajax form submission, which can be enabled in the backend configuration. In order to use it, you have to update FrontendForms to version 1.2.47 first, which includes all changes to support Ajax form submission.

    You can read more about this new feature in the FrontendForms forum.

    Best regards

  16. Version 2.1.47 is out!!

    Now FrontendForms supports Ajax form submission!

    Ajax form submission prevents a page reload after the form has been submitted. This could be useful in scenarios, where you do not want a reload (fe if your form is inside a modal box or inside a tab) after the form has been submitted. You can disable/enable Ajax submission by checking a checkbox inside the module configuration, or you can overwrite the global value by using the setSubmitWithAjax() method on per form base.

    If you are enabling this feature, a progress bar will be displayed after you have pressed the submit button to inform the user, that the form will be validated now. Otherwise, the user will not see any action until the validated form will be loaded back into the page. If you do not want to show the progress bar, you can disable it inside the module configuration too. With the showProgressbar() method, you can overwrite this global setting on per form base.

    In the case, you want to redirect the visitor to another page, after the form has been submitted successfully, you cannot do this via a PHP session redirect, because the form has been submitted via Ajax. In this case a JavaScript redirect has to be done. To force a JS redirect after the submission, you need to use the setRedirectUrlAfterAjax() method. Put the new URL inside the parenthesis, and the user will be redirected to this URL after the form has been validated successful.

    You will find a more detailed information about these 3 new methods here: https://github.com/juergenweb/FrontendForms/blob/main/README.md#setsubmitwithajax---use-ajax-for-form-submission

    Screenshot of the new Ajax configuration settings:

    319749026_Screenshot2023-10-09at17-18-34ModuleFrontendFormswebseite2_at.thumb.png.2675fc23c850348533ecc4d7e20bd56d.png

    As always, please test your forms if you are changing to Ajax support and report any bugs directly on Github. A lot of changes have been done, so keep an eye on unwanted side effects.

    I have tested it with my other module FrontendContact too and it works without problems if you are using Ajax support.

    Best regards!

    • Like 3
    • Thanks 1
×
×
  • Create New...