-
Posts
1,221 -
Joined
-
Last visited
-
Days Won
10
Posts posted by Juergen
-
-
OK, other people have struggled with same problem too. Using the module upgrade() function is the way to go, that works.
https://processwire.com/talk/topic/26912-module-update-function/#comment-222616
Problem solved 😀
- 1
-
Yeah, I have tried that, but nothing had happened. But maybe I have done something wrong. I will take a look if owerwriting, as you have it done, will be the better way to go.
Thanks for your help!!!
- 1
-
Hello @all
I need a Hook that will run after a user updates a module from the PW module directory.
The reason for that is, that the update only affects files which are inside the updated module itself. If a module creates files or directories on other places of the systen, they will never get affected during an update.
In my case, my FrontendForms module copies a file (captchaimages.php) from the module to the root directory of the PW installation during the installation process of the module. The problem is, if I update this file, running an update will never updates the file in the root directory. So this file will never be touched again after the installation.
For this reason I need a Hook, that will run after a module was updated successfully, so I can write a code to update this file manually (or in other words to replace the file inside the root with the file from the update version).
Can anyone help me if there is an appropriate Hook.
Thanks in advance
-
Hello @Mfeuille
Thanks for reporting your issue!
Can you confirm that you have the required PHP version (8.0) installed. It seems that your system does not understand the union types on that lines. This is the case if you have a lower PHP version.
Best regards Jürgen
-
This is the next module beside the FrontendLoginRegister module which is based on the FrontendForms module.
As the name suggests, it has been designed to easily create a contact form for your site with the following characteristics:
- Fast and easy integration of a contact form inside a template by using only one line of code
- Show/hide certain fields of the form depending on your preferences and needs
- Beside the default fields you will be able to extend the form with additional fields if needed
- Highly customizable (change order of fields, add custom CSS classes,...)
- Run as many forms on one page as you want
- Possibility to offer file upload to upload multiple files, which can be sent as attachments
- Usage of all the benefits of FrontendForms (fe. CAPTCHA, various security settings,...)
- Multi-language
- IP of the sender will be send with the email too, so you can use it for IP-blocking if you will get a lot of spam from a certain IP
To render a complete working contact form, you will only need to add this line of code to your template:
echo $modules->get('FrontendContact')->render();
The output can differ from the image above, because it depends on your settings and customizations, but it will looks like similar to the form in the image.
This module is completely new and therefore alpha stage - so be aware of using it on live sites!
It works as expected in my tests, but it will need further testing.
You can download the module here: FrontendContact or you can install it via the Processwire upgrade-module from the module directory. Alternatively you will find all files inside GitHub.
You will also find a more detailed description on the the download page.
Live example of this module: https://www.schulfreund.at/kontakt/
As always, please report issues or wishes here or directly on GitHub.
Thanks for testing!
- 7
-
@Andy I will probably thinking over to add this feature (support for image upload). Technically, uploading an image without image manipulation should not be a problem in this case. At the moment I am quite busy on creating a new module for a contact form based on FrontendForms, but if I have more time left, I will probably give this feature a chance.
Best regards
- 1
-
Hi Andy,
Maybe you are thinking of profile images?
I have thought about it, but my experience in the the past has shown me, that users do not upload profile images.
A few years ago I have created a user registration with the opportunity to upload a profile image, but no one has used it... so I dont think so, because it would only make sense if you can manipulate (crop, position,..) the image after the upload to get the best fit for the image. This is very complex to implement.
Best regards
- 1
-
Thank you for the hint @eydun
I have added the requirements to the docs.
- 1
-
The custom user fields will be taken from the user template and mapped to the FrontendForms class. So PW fields will be re-written to FrontendForm fields.
Take a look at https://github.com/juergenweb/FrontendLoginRegister#support-for-custom-user-fields
Some of the values as set in the PW fields will be added to the FrontendForm fields too.
Example: If you take the PW password field and you have set the requirements to at least "1 letter and 1 digit", this requirement will also be used in the Frontendforms input field for the password on the frontend.
Validation will only be taken by FrontendForms.
Does this answer your question?
- 3
-
Ok, Claus! You are close to the solution.🙂 You will get every value by its name attribute. To add all of them to the body, I recommend you concatenate all the values in one string.
$email = $form->getValue('email'); $message = $form->getValue('message');
If you have all of your $_POST values than you create your body string (fe with a little HTML markup).
$body = '<ul><li>Email: '.$email.'</li><li>Message: '.$message.'</li></ul>;
As the last step, add it to the mail body:
$m->body($body); // or if you want to use HTML markup $m->bodyHTML($body);
You will find a working example at https://github.com/juergenweb/FrontendForms/blob/main/Examples/contactform.php
Best regards
PS: If you will need help, please post the code of your form here.
- 2
-
Hello Claus,
thank you for reporting the bug - it is fixed now. There was a missing typehint declaration at the label file.
I have updated the module now to 2.1.26 - alternatively please replace the folllowing file: https://github.com/juergenweb/FrontendForms/blob/main/Formelements/Textelements/Label.php
On line 20 I have changed the following:
protected int $enableAsterisk = 1; // to protected int|string $enableAsterisk = 1;
Best regards Jürgen
- 1
-
A module for ProcessWire CMS to integrate a user registration/login functionality based on the FrontendForms module. This module creates pages and templates during the installation for faster development.
The intention for the development of such a module was to provide a ready-to-use solution for user management, which can be installed and put into operation in a few minutes.
It works out of the box, but it provides a lot of configuration settings in the backend:
Highlights
- "One-click" integration of an user login/registration system without the hazzle of creating all pages and forms by hand
- "One-click" switch between login or login and registration option
- Double opt-in with activation link on new registrations
- Option for automatic sending of reminder mails, if account activation is still pending
- Option for automatic deletion of unverified accounts after a certain time to prevent unused accounts
- Option to use TFA-Email if installed for higher security on login
- Mutli-language
- Select if you want to login with username and password or email and password
- Select the desired roles for newly created users
- Select, which fields of the user template should be displayed on the registration and profile form (beside the mandatory fields). Fields and order can be changed via drag and drop functionality
- Offer users the possibility to delete their account in the members area using a deletion link with time expiration
- Customize the texts of the emails which will be send by this module
- Usage of all the benefits of FrontendForms (fe. CAPTCHA, various security settings,...)
- Support for SeoMaestro if installed
- Lock accounts if suspicious login attempts were made
- Support of Ajax form submission
This module runs on top of the FrontendForms module, so please download and install this module first.
UPDATE 03.11.2023: The module is now available inside the Processwire modules directory: Frontendloginregister
This module is early Beta stage, so please do not use it on live sites at the moment.
If you discover any issues, please report them directly on GitHub 🙂. Thanks!
- 15
- 4
-
43 minutes ago, Zeka said:
public function getModuleConfigInputfields(array $data) { .... foreach ($inputfields->getErrorInputfields() as $inputfield) { $inputfield->collapsed = Inputfield::collapsedNo; $parents = $inputfield->getParents(); foreach ($parents as $parent) { $parent->collapsed = Inputfield::collapsedNo; } } return $inputfields; }
This works!!! Thank you so much!!!
I can confirm, that the fieldset was always closed in my case. Maybe it has something to do, that the error was produced by a custom inputfield validator via a Hook.
Best regards Jürgen
- 1
-
Hello @all
I have a configurable module and for better overview i have created a lot of fieldsets where I have placed configuration fields inside. By default all fieldsets are closed.
So if an error occurs in one field after saving the module, I get the error message at the top, but the fieldset which includes the field with the error keeps closed. This is not very userfriendly, because you will not know in which of the fieldsets is the field which causes the error (I know, where to look, but someon who does not know my module will not...)
So it would be great if the fieldset with the error field inside will be opened, after the form processing.
Is there an inbuilt way to achive this or has someone struggled with the same problem and has found a working solution and will be so kind to post it here?
Thanks in advance
- 1
-
Hello @xweb
The placeholder is an attribute and you can add every attribute with the setAttribute() method described here.
$yourField->setAttribute('placeholder', 'Enter your first name'); // or with translatable strings $yourField->setAttribute('placeholder', _('Enter your first name'));
Replace $yourField with the variable name of your field object and your done 😀!
You can do this in the same way for every attribute (class, data-attribute, id, rel,.....).
Have a nice day!
Jürgen
- 1
-
Version 2.1.19 contains changes to make the module compatible with PHP 8.2 and following versions.
All dynamically created properties have been removed and replaced by a declared property which hold all the properties inside an array. The reason for this is that dynamicalle created properties will be depreciated in 8.2 (leads to a warning) and the will be forbidden in upcoming PHP 9.
So, this was a change affecting a huge amount of files. So please test it carefully and report any issues directly on GitHub.
IMPORTANT!
Due to a writing mistake, there are wrong values inside the database: These wrong values will not be overwritten during the update. It is recommended to uninstall and reinstall the module after the update to be sure that the correct values are stored inside the database. Otherwise it is most likely that you will get an error after a form submission.
Just to mention: the error is in the fieldname of the custom messages: instead of the field name "input_alertErrorText" and "input_alertSuccessText" I have written "input_input_alertSuccessText" and "input_input_alertErrorText". This causes an error after form submission.
Thanks a lot!
- 2
-
Could you please download and replace the following file:
https://github.com/juergenweb/FrontendForms/blob/main/FrontendForms.module
Let me know, if the error is gone
- 1
-
Ok, give me a minute, I will add an if condition. In the meantime you can take a look at the example of uploading a file to page.
https://github.com/juergenweb/FrontendForms/blob/main/Examples/fileuploadtopage.php
This is the way to go - I have tried it and it works in my case.
- 2
-
Ok, in this case you should point the upload folder to be the folder with the id of your page inside the files directory
// add this to your form object $form->setUploadPath($page->id, true);
I have not tested it, but it should create a folder with the id of your page under the site/assets/ directory and store the file, that you have uploaded inside.
-
This may be interesting for you too, if you want to upload the files to a specific directory: https://github.com/juergenweb/FrontendForms#setuploadpath
-
Do you want it to send it with emails, then you have to add the sendAttachments(); methods to the WireMail object as written at the bottom of the file, or do you only want to upload it to the files directory?
-
Hi @pmichaelis,
it is indeed a little bit hidden, but you will find an example of a single and a multiple file upload field inside the example of the contact form at
https://github.com/juergenweb/FrontendForms/blob/main/Examples/contactform.php
Best regards
- 1
-
Hello @Stefanowitsch
There was a wrong query string inside the method, which is responsible to find all frontend templates. I have corrected it on Github. You do not need to download and install the whole module. Please replace the file JkPublishPages.module from the module with the new one at Github and let me know, if it works now. I have bumped up the module version too, because this was a significant malfunction.
BTW: you can set the child settings to no again and only to mention: the homepage is excluded from the templates.
- 1
-
My explanation, was for the parent pages, not for adding the publishing fields to the template. To clearify: This blog post template will not be visible at the checkboxes list for the templates in your case?
I will take a closer look on my local installation and give you a feed back after lunch. I guess there will be a problem in querying templates.
- 1
Hooking after updating a module from the module directory? [SOLVED]
in Module/Plugin Development
Posted
You will pass every police interview! 😁