SuiteCRM
SuiteCRM copied to clipboard
Differences between saved and unsaved versions of Create Person Form
Issue
After creating a newsletter Campaign (with appropriate Target Lists and Email Template), I try to create a web-to-target form using Create Person Form.
The initial screen shows PHP code to add to my website, and it also has a save button. I'm not entirely sure of the purpose of the save button since it doesn't seem to actually be retrievable later. But the resulting page also has the PHP code to add to the website, however it is slightly different.
I'm not sure why it's different or which version is the correct one to use.
Expected Behavior
The "Create Person Form" generated PHP should be identical whether it is saved or not.
Actual Behavior
Here are the differences for the particular form I generated:
-
The saved version includes the html element, e.g.
whereas the unsaved version only included the style tag:
<style type="text/css">
This is not a problem, since the saved version is obviously intended to be used as a standalone web page while the unsaved version can be inserted into an existing web page. But it is unexpected; a cleaner user experience might be to show the style element only, with an explanation that it is meant to be inserted into an existing web page.
-
The saved version has a lot of extra blank lines (not a problem, just an unexpected difference)
-
The unsaved version has an extra commented-out script element inside a comment marked "TODO ???"; the saved version has the TODO but not the script element. Also not a problem, but the entire comment should be left out, or the element should be uncommented if appropriate.
-
The saved version has this for the submit button:
while the unsaved version has:
<input type="submit" onclick="submit_form();" class="button" name="Submit" value="Confirm" />
I would guess the unsaved version is more correct, but I'm not sure.
- The unsaved version correctly has a script element surrounding some JavaScript functions at the bottom, while the saved version leaves them bare (which of course does not work if added to a web page and just shows them as plaintext).
Possible Fix
Suggestions above (though I'm not sure about the submit button)
Steps to Reproduce
- Create a campaign.
- Select Create Person Form.
- Copy the resulting PHP into a file.
- Save the form.
- Copy the PHP on the resulting page into a different file.
- Compare the files.
Context
I don't believe this is causing problems, but I'm not sure, and having them identical would avoid second-guessing.
Your Environment
- SuiteCRM Version used: 8.1.2
- Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 91.11.0esr
- Environment name and version (e.g. MySQL, PHP 7):
- MariaDB 10.5.16
- PHP 8.0.21 (from remi repo, so IMAP support is built in)
- Apache HTTP Server 2.4.54
- PHP-FPM 8.0.22
- Operating System and version (e.g Ubuntu 16.04): Fedora 35