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

36784 Plugin can not set supervisor in address record #594

Merged

Conversation

dai-eastgate
Copy link
Contributor

@dai-eastgate dai-eastgate commented Jul 17, 2023

related to #553

changed log :
Add supervisor to address record when sending contact form in detail page

@github-actions
Copy link

github-actions bot commented Jul 17, 2023

Pull Request Test Coverage Report for Build 5886855372

  • 45 of 47 (95.74%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 79.134%

Changes Missing Coverage Covered Lines Changed/Added Lines %
plugin/Form/FormAddressCreator.php 27 29 93.1%
Totals Coverage Status
Change from base Build 5864931474: 0.07%
Covered Lines: 7547
Relevant Lines: 9537

💛 - Coveralls

@onOffice-Web onOffice-Web added the QA Issue or Pull request that is in review label Jul 17, 2023
@onOffice-Web onOffice-Web added this to the v4.14 milestone Jul 17, 2023
@fredericalpers fredericalpers linked an issue Jul 28, 2023 that may be closed by this pull request
@yeneastgate yeneastgate requested a review from andernath August 2, 2023 04:11
Copy link
Contributor

@andernath andernath left a comment

Choose a reason for hiding this comment

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

@dai-eastgate
Looks good. I just found a missing part in documentation. Please take a look. :)

@@ -68,7 +68,7 @@ public function __construct(
* @throws NotFoundException
*/
public function createOrCompleteAddress(
FormData $pFormData, bool $mergeExisting = false, string $contactType = ''): int
FormData $pFormData, bool $mergeExisting = false, string $contactType = '', int $estateId = null): int
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add PHPDoc for these arguments: $contactType and $estateId for complete documentation? :)

@@ -82,6 +82,13 @@ public function createOrCompleteAddress(
if ( key_exists( 'newsletter', $requestParams ) ) {
unset( $requestParams['newsletter'] );
}
if (!empty($estateId)) {
$userName = $this->getSupervisorUsernameByEstateId($estateId);
if (!empty($userName)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the past we got minor bugs with using empty() function because "0" and 0 is also empty true. It is unlikely but what happens if the ID or username is 0?

Do you think using isset could be better or could causes other errors?

Edit:
Oh I see getSupervisorUsernameByEstateId returns maybe an empty string. So I guess we need empty() here.

Copy link
Contributor Author

@dai-eastgate dai-eastgate Aug 31, 2023

Choose a reason for hiding this comment

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

I'll check and let you know asap

@dai-eastgate dai-eastgate requested a review from andernath August 31, 2023 10:05
@dai-eastgate
Copy link
Contributor Author

@andernath I fixed it, please review again for me. Thanks

Copy link
Contributor

@andernath andernath left a comment

Choose a reason for hiding this comment

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

Thanks, I will start testing.

@github-actions
Copy link

Steps to install the approved version:

  1. Download onoffice-4.13-4-gb11a8ccf-please-unpack.zip from https://github.com/onOffice-Web-Org/oo-wp-plugin/actions/runs/6036021670.
  2. Unpack the downloaded file to get another .zip file.
  3. Upload that inner .zip file to WordPress.

@andernath andernath merged commit d7412e4 into master Aug 31, 2023
6 checks passed
@andernath andernath deleted the 36784-plugin-can-not-set-supervisor-in-address-record branch August 31, 2023 10:58
@andernath andernath added ready for release and removed QA Issue or Pull request that is in review labels Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin can not set supervisor in address record
3 participants