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 error when saving contact details with an empty type #968

Merged
merged 4 commits into from Oct 31, 2023

Conversation

pierredup
Copy link
Member

Fixes #966

@pierredup pierredup added the bug label Oct 31, 2023
@pierredup pierredup added this to the 2.2.6 milestone Oct 31, 2023
@pierredup pierredup self-assigned this Oct 31, 2023
@what-the-diff
Copy link

what-the-diff bot commented Oct 31, 2023

PR Summary

  • Inclusion of ContactTypeEntity in ContactDetailType.php
    The ContactTypeEntity from SolidInvoice\ClientBundle\Entity library has been incorporated in the ContactDetailType.php file for smoother handling of client contact details.

  • New Constraint on Contact Detail Type field
    Now there's a constraint enforcing that the type field in contact details cannot be left blank. This ensures more uniformity in the databases by preventing incomplete information.

  • Form Modification in 'contact_details.html.twig'
    The form has been altered from form_widget to form_row for the type field in 'contact_details.html.twig', changing how the user interacts with the form.

  • Addition of form_errors in 'contacts.html.twig'
    Now, any errors encountered in the user form for contact details will be clearly visible to the user because of the addition of form_errors function.

  • Addition of ContactType in EntityUuidTransformer.php
    ContactType from SolidInvoice\ClientBundle\Entity is now imported in EntityUuidTransformer.php for smoother data transformation related to contact types.

  • Modification of transform Method in EntityUuidTransformer.php
    The transform method now checks if a given value is an instance of ContactType before returning its id, ensuring smoother data transformation and data integrity.

  • Modification of reverseTransform Method in EntityUuidTransformer.php
    The reverseTransform method has been modified to return null if the given value is an empty string or null, further ensuring data integrity and streamlining data transformation process.

@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 45 lines in your changes are missing coverage. Please review.

Comparison is base (5d115d0) 50.97% compared to head (33655c8) 50.76%.
Report is 17 commits behind head on 2.2.x.

Additional details and impacted files
@@             Coverage Diff              @@
##              2.2.x     #968      +/-   ##
============================================
- Coverage     50.97%   50.76%   -0.21%     
- Complexity     2229     2240      +11     
============================================
  Files           442      443       +1     
  Lines          8295     8340      +45     
============================================
+ Hits           4228     4234       +6     
- Misses         4067     4106      +39     
Flag Coverage Δ
unittests 50.76% <27.41%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/ClientBundle/Form/Type/ContactDetailType.php 100.00% <100.00%> (ø)
...dle/Form/DataTransformer/EntityUuidTransformer.php 76.92% <100.00%> (ø)
src/InstallBundle/Listener/RequestListener.php 96.66% <100.00%> (ø)
src/InstallBundle/Listener/UpgradeListener.php 56.25% <100.00%> (ø)
src/MailerBundle/Factory/MailerConfigFactory.php 87.50% <100.00%> (-0.74%) ⬇️
src/SettingsBundle/SystemConfig.php 71.42% <100.00%> (ø)
src/CoreBundle/ConfigWriter.php 0.00% <0.00%> (ø)
src/CoreBundle/Repository/VersionRepository.php 36.84% <0.00%> (ø)
src/InstallBundle/Action/Install.php 0.00% <0.00%> (ø)
src/InstallBundle/Command/InstallCommand.php 0.00% <0.00%> (ø)
... and 4 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pierredup pierredup linked an issue Oct 31, 2023 that may be closed by this pull request
@pierredup pierredup merged commit 7bc6cb0 into 2.2.x Oct 31, 2023
16 of 20 checks passed
@pierredup pierredup deleted the fix-contact-type-error branch October 31, 2023 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: Call to a member function getName() on null
1 participant