Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix form submit messages length #10266

Merged
merged 10 commits into from Nov 10, 2021

Conversation

julienWebmecanik
Copy link
Contributor

@julienWebmecanik julienWebmecanik commented Jul 16, 2021

Q A
Branch? "features"
Bug fix? yes
New feature? no
Deprecations? no
BC breaks? no
Automated tests included? no

Description:

Form validation messages were generating "errors 500" when longer than 191 char. This PR fixes it.

Steps to test this

  1. Run DB migrations
  2. Create a form add a long text (over 300 chars) in the form validation message input
  3. Submit it
  4. See that there is no errors

@cla-bot cla-bot bot added the cla-signed The PR contributors have signed the contributors agreement label Jul 16, 2021
@codecov
Copy link

codecov bot commented Jul 16, 2021

Codecov Report

Merging #10266 (8271041) into 4.0 (7b85da4) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##                4.0   #10266   +/-   ##
=========================================
  Coverage     42.97%   42.97%           
  Complexity    34528    34528           
=========================================
  Files          2062     2062           
  Lines        115611   115611           
=========================================
  Hits          49681    49681           
  Misses        65930    65930           
Impacted Files Coverage Δ
app/bundles/FormBundle/Entity/Form.php 79.02% <100.00%> (ø)

@npracht npracht added bug Issues or PR's relating to bugs forms Anything related to forms ready-to-test PR's that are ready to test T1 Low difficulty to fix (issue) or test (PR) labels Jul 16, 2021
@npracht npracht added this to the 4.0.1 milestone Jul 16, 2021
@RCheesley
Copy link
Sponsor Member

Hi @julienWebmecanik I tested this with a couple of different fields but was unable to reproduce the issue:

screenshot-mautic4 ddev site-2021 07 16-12_53_18

Maybe we need a bit more detail on how to reproduce the problem?

@RCheesley RCheesley added the pending-feedback PR's and issues that are awaiting feedback from the author label Jul 16, 2021
Copy link
Member

@fedys fedys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job @julienWebmecanik! Your PR fixes the issue. I found some issues that needs to be addressed though.

app/migrations/Version20210623071326.php Outdated Show resolved Hide resolved
app/migrations/Version20210623071326.php Outdated Show resolved Hide resolved
app/migrations/Version20210623071326.php Outdated Show resolved Hide resolved
@fedys
Copy link
Member

fedys commented Aug 16, 2021

@RCheesley I was able to reproduce the error. It is connected with Redirect URL/Message field.

reproduce.mov

This PR fixes the issue. There is an issue in the migration that needs to be addressed.

@julienWebmecanik
Copy link
Contributor Author

julienWebmecanik commented Aug 27, 2021

Thanks @fedys for the review, I pushed the requested changes.

@npracht npracht removed the pending-feedback PR's and issues that are awaiting feedback from the author label Aug 27, 2021
@npracht npracht requested a review from fedys August 27, 2021 08:15
fedys
fedys previously approved these changes Aug 27, 2021
Copy link
Member

@fedys fedys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @npracht

@kuzmany kuzmany added pending-test-confirmation PR's that require one test before they can be merged and removed ready-to-test PR's that are ready to test labels Aug 27, 2021
@RCheesley RCheesley changed the base branch from features to 4.0 September 7, 2021 11:43
@ts-navghane ts-navghane added ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed pending-test-confirmation PR's that require one test before they can be merged labels Sep 8, 2021
@ts-navghane
Copy link
Contributor

Tested and works as expected. Code LGTM! Thank you @julienWebmecanik

@RCheesley
Copy link
Sponsor Member

@all-contributors please add @fedys for review

@allcontributors
Copy link
Contributor

@RCheesley

I've put up a pull request to add @fedys! 🎉

@RCheesley
Copy link
Sponsor Member

@julienWebmecanik it looks like there is a code style issue that need addressing - possibly an unused import:

https://github.com/mautic/mautic/pull/10266/checks?check_run_id=3601317475#step:8:31

Could you take a look?

@RCheesley
Copy link
Sponsor Member

Removing from the milestone due to failing tests - can consider for a future release when the codestyle issue has been addressed.

@RCheesley RCheesley removed this from the 4.0.1 milestone Sep 27, 2021
@julienWebmecanik
Copy link
Contributor Author

@RCheesley sorry it took so long, I ran cs-fixer on that migration, looks good now

@RCheesley
Copy link
Sponsor Member

OK great - should be able to get this out in the 4.0.2 release :)

@RCheesley RCheesley added this to the 4.0.2 milestone Oct 1, 2021
Copy link
Member

@dennisameling dennisameling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback has been addressed and tested by others 👍🏼 merging this now!

@dennisameling dennisameling merged commit 8dcf3ee into mautic:4.0 Nov 10, 2021
RCheesley added a commit that referenced this pull request Nov 22, 2021
* Update Mautic version in GitHub issue form

* Change webhook_url column type to text (#10407)

* Fix points in webhook after form submission (#10144)

* Fix points in webhook after form submission

* CS fixer

* Add unit tests

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix array parameters from tracking query (#10404)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Asset language as required (#10406)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* add missing attribute (#10355)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Add no_unused_imports to CS fixer (#10317)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix bad date format. (#9767)

Signed-off-by: Giovanni Mascellani <giovanni@mascellani.eu>

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix form issues with file type field (#9233)

* Fix form issues with file type field

* Fix unit tests

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Video form select optimization (#10276)

* Optimizing of loading of forms into a gated video select box

Now we are loading only the ID and label instead of all columns and it will also load only published forms

* Correction of the test folder

* Container has become a static property 🤷

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Prevent exception when creating a new field when background processing is enabled (#9761)

* Add missing properties for custom field responses

* Give option to api controllers to handle saving the entity

* Return 202 (accepted) when fields are processed in the background rather than throwing an uncaught exception

* Added AbstractMauticTestCase::$configParams property

* Removed 'charLengthLimit' from LeadField::loadApiMetadata()

Co-authored-by: Alan Hartless <alan@devkardia.com>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Re-apply the patch from the PR #10462 (#10482)

Co-authored-by: Adrian Schimpf <adrian@idea2.ch>

* bumping to version 4.0.1

* Update PR template to reflect new branching strategy (#10440)

Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Bump version to 4.0.2-beta (#10520)

* Bump php-cs-fixer from 2.16.10 to 2.19.2 (#10519)

* Bump php-cs-fixer from 2.16.10 to 2.19.2

* Run fixcs command on whole codebase

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix Doctrine metadata cache handling during installation (#10481)

* Don't clear cache during installation

* Add tests to increase coverage

* Fix CS

* Fix UI installer by clearing ORM metadata cache

* Update Codecov GH Action to v2 (#10530)

* [BUGFIX] Removed apostrophe from email validation (#10413)

* [BUGFIX] Removed apostrophe from email validation

* [BUGFIX] altered tests for apostrophe check

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Bump version to 4.0.2-rc to fix CodeCov (#10559)

* Removed composer v1 requirement in README (#10586)

* Salesforce: Check DNC status (#9956)

Co-authored-by: Norman Pracht - Webmecanik <npr@webmecanik.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix campaign membership syncing when an issue such as api limits occur (#7514)

* Only recognize integration entity entries for contacts that still exist in Mautic

* CS fix

* Fixed issue that caused date/time to be cached for campaign membership when something in fetching unknown contacts fails such as an api limit error (in getLeads)

* CS fix

* Fixed missing parameter

* Fixed CS

* Implement function test to improve code coverage.

* Improve the test.

* Add strict types.

* Add more assertions.

* fix failing test case

Co-authored-by: Anton Vlasenko <vlasenko.anton@gmail.com>
Co-authored-by: Dennis Ameling <dennis@dennisameling.com>
Co-authored-by: Anton Vlasenko <43744263+anton-vlasenko@users.noreply.github.com>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Saurabh Gupta <saurabh.gupta@acquia.com>

* Fix date range  in segments and reports does not trigger ajax request (#10421)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Set install_source to DDEV for local dev (#10595)

* Fix process string in contact's audit log (#10061)

Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix display zero values in reports (#10167)

Co-authored-by: Joey Keller <jos0405@gmail.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix SES multiple unsubscribe header (#10557)

Co-authored-by: Mohammad Abu Musa <m.abumusa@gmail.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix email translations lost and overwritten by parent (#10525)

* Fix email translations lost and overwritten by parent email content

* Add unit tests

* CS fixer

* Remove SORTARRIVAL define

* Test code coverage increased

* CS fix

* CS fix

* CS fix

* CS fix

Co-authored-by: Mohit Aghera <mohit.beta@gmail.com>
Co-authored-by: fedys <miroslav.fedeles@gmail.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix dashboard widget Sent email to contacts (#10166)

Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Place the .gitignore in the project root, not the webroot (#10300)

* Place the .gitignore in the project root, not the webroot

* Update composer.json

Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Bring .github changes over to 4.0 (#10597)

* Split up monorepo jobs (#10600)

* Fix trigger inactive schedule decision after scheduled event (#9486)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Dennis Ameling <dennis@dennisameling.com>
Co-authored-by: Mohit Aghera <mohit.beta@gmail.com>

* Focus: hide form If we use notice type of popups  (#10527)

* Focus: hide form If we use notice type

* Added unit tests

* Remove comment

* remove mixed from tests

according to John's feedbacks

Co-authored-by: Norman Pracht - Webmecanik <npr@webmecanik.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix salesforce sync companies even are disabled (#10497)

* Fix salesforce sync companies even are disabled

* Fix PHP Stan report

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* fix JS (#10495)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix Invalid clickthrough value exception (#10444)

* Fix Invalid clickthrough value exception

* Fix Invalid clickthrough value exception

* Add unit tests

Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* [BUGFIX] using preg_grep because Contents will be an array (#10308)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* enclosing sender name with double quotes (#10326)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Norman Pracht - Webmecanik <npr@webmecanik.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix form submit messages length (#10266)

* Allow longer form submit message than 191 characters

* Review changes

* Run cs-fixer on migrations

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix A new entity was found through the relationship 'Mautic\LeadBundle\Entity\Company#owner (#9328)

* MAUT-3669 / Salesforce syncing fails with "A new entity was found through the relationship 'Mautic\LeadBundle\Entity\Company#owner'"

* Fix inability to update Mautic lead fields if the value that is coming from the integration is empty.

* Covering the new methods with tests

* Moving the new test to the correct dir

* Revert "Fix inability to update Mautic lead fields if the value that is coming from the integration is empty."

This reverts commit 392a3e1

* Fixed CompanyObjectHelperTest

Co-authored-by: Anton Vlasenko <vlasenko.anton@gmail.com>
Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Add select/multiselect to NormalizedValueDAO from internal object (#9919)

* Add select/multiselect to FieldDAO from internal object

* Added unit test for IntegrationBundle/FieldHelper:getNormalizedFieldType

Co-authored-by: Julien Ulm <jul@webmecanik.com>
Co-authored-by: Norman Pracht - Webmecanik <npr@webmecanik.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Some winner criteria not working properly in A/B Tests (#9936)

* Fixed lowest bounce rate calculation for A/B testing.

* Fixed download rate not working for emails A/B testing.

* Fixed test case for lowest bounce rate calculation for A/B testing.

* Fixed and added test cases for asset redirect.

* Fixed an edge case where 0 bounces were not being considered

* Fixed A/B stats pop up box not closing.

* Fixed failing test case.

* update row.html.php with typo in translation string

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Norman Pracht - Webmecanik <npr@webmecanik.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Add unit test for extractCompanyDataFromImport (#10064)

Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Unable to perform "Change campaign" Action for removing a contact from one and adding to another campaign (#10151)

* Source contact was not removed from campaign

* remove extra file

Co-authored-by: Zdeno Kuzmany <zdeno@kuzmany.biz>
Co-authored-by: Joey Keller <jos0405@gmail.com>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix dashboard report line graphs (#10209)

* Fix dashboard report line graphs

* Functional test

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: fedys <miroslav.fedeles@gmail.com>
Co-authored-by: Joey Keller <jos0405@gmail.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* Fix sync salesforce if company has name with html entity code of singlequote (#10535)

* fix(escapequeryvalue): moved escape single quote after the decode

If in db i saved a value with html entity of single quote ( &#39; ), escape of single quote doesn't works,
then decode convert html entity in single quote and the query breaks. To avoid this bug i move the escape
of single quote after the decode

* test(salesforceapitest): update test with the new case of html entity

* Fix API creating tag duplicates (#10270)

* Fix API tag duplicates

* Add tag API controller functional test

* Add ApiController test

Co-authored-by: Mohammad Abu Musa <m.abumusa@gmail.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>
Co-authored-by: Dennis Ameling (he/him) <dennis.ameling@leap.ac>

* Fix duplicate entry for key campaign_rotation (#9639)

* Fix Duplicate entry ... for key campaign_rotation

* Add EventLoggerTest::testHydrateContactRotationsForNewLogs()

- Very simple test since repository should be tested spearately

* Add unit tests

* Fix getIpAddress in testBuildLogEntry

Co-authored-by: Dennis Ameling <dennis@dennisameling.com>
Co-authored-by: Julien Ulm <jul@webmecanik.com>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix form field campaign condition with special character in value (#10470)

* Fix form field campaign condition with special character in value

* Test added to cover comparing form field values with an apersand

* Setting undefined keys

* Have to drop the form submission table that is autogenerated

* Temporary test skip

* Adding checks and debug info to problematic tests

* Using dynamic campaign ID in a failing test

* Adding more details to the failing test

* Using dynamic IDs for contacts in a fragile test

* Make email unique for the test as if John Doe was ever created by another test before this test will fail.

* Use dynamic IDs in a fragile test

* One more place where to use dynamic ID

* Replacing forgotten hard-coded ID

* Select the right audit log record

Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>

* update getManager methodcall (#10589)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix set values from properties for state field (#10486)

* Fix set values from properties for state field

* Fix If sortable use wrong input format

* Revert back return value for normalize values

* Coverint CustomFieldValueHelper::setValueFromPropertiesList with tests

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: John Linhart <admin@escope.cz>

* Bump version to 4.0.2-stable

* Regenerating  phpstan baseline to merge 4.0 to 4.x

Co-authored-by: Zdeno Kuzmany <zdeno@kuzmany.biz>
Co-authored-by: Mohammad Abu Musa <m.abumusa@gmail.com>
Co-authored-by: Giovanni Mascellani <giovanni@mascellani.eu>
Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Miroslav Fedeleš <miroslav.fedeles@gmail.com>
Co-authored-by: Alan Hartless <alan@devkardia.com>
Co-authored-by: Mohit Aghera <mohit.beta@gmail.com>
Co-authored-by: Adrian Schimpf <adrian@idea2.ch>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>
Co-authored-by: Leon <55587275+oltmanns-leuchtfeuer@users.noreply.github.com>
Co-authored-by: Norman Pracht - Webmecanik <npr@webmecanik.com>
Co-authored-by: Anton Vlasenko <vlasenko.anton@gmail.com>
Co-authored-by: Anton Vlasenko <43744263+anton-vlasenko@users.noreply.github.com>
Co-authored-by: Saurabh Gupta <saurabh.gupta@acquia.com>
Co-authored-by: Joey Keller <jos0405@gmail.com>
Co-authored-by: Patryk Gruszka <patryk.gruszka@comarch.pl>
Co-authored-by: Nick Veenhof <nick.veenhof@gmail.com>
Co-authored-by: Lukas Günther <lukas.guenther@pm.me>
Co-authored-by: Pedro Egg <pedroegg123@yahoo.com.br>
Co-authored-by: julienWebmecanik <79137416+julienWebmecanik@users.noreply.github.com>
Co-authored-by: Julien Ulm <jul@webmecanik.com>
Co-authored-by: Tejas Navghane <ts.navghane@gmail.com>
Co-authored-by: Saurabh Gupta <48244990+dadarya0@users.noreply.github.com>
Co-authored-by: Alfredo Arena <50916237+alfredoct96@users.noreply.github.com>
Co-authored-by: Dennis Ameling (he/him) <dennis.ameling@leap.ac>
indorock pushed a commit to unikrn/mautic-fork that referenced this pull request Nov 26, 2021
* official/4.0: (40 commits)
  Bump version to 4.0.2-stable
  Fix set values from properties for state field (mautic#10486)
  update getManager methodcall (mautic#10589)
  Fix form field campaign condition with special character in value (mautic#10470)
  Fix duplicate entry for key campaign_rotation (mautic#9639)
  Fix API creating tag duplicates (mautic#10270)
  Fix sync salesforce if company has name with html entity code of singlequote (mautic#10535)
  Fix dashboard report line graphs (mautic#10209)
  Unable to perform "Change campaign" Action for removing a contact from one and adding to another campaign (mautic#10151)
  Add unit test for extractCompanyDataFromImport (mautic#10064)
  Some winner criteria not working properly in A/B Tests (mautic#9936)
  Add select/multiselect to NormalizedValueDAO from internal object (mautic#9919)
  Fix A new entity was found through the relationship 'Mautic\LeadBundle\Entity\Company#owner (mautic#9328)
  Fix form submit messages length (mautic#10266)
  enclosing sender name with double quotes (mautic#10326)
  [BUGFIX] using preg_grep because Contents will be an array (mautic#10308)
  Fix Invalid clickthrough value exception (mautic#10444)
  fix JS (mautic#10495)
  Fix salesforce sync companies even are disabled (mautic#10497)
  Focus: hide form If we use notice type of popups  (mautic#10527)
  ...

# Conflicts:
#	composer.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs cla-signed The PR contributors have signed the contributors agreement forms Anything related to forms ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged T1 Low difficulty to fix (issue) or test (PR)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants