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

Remove legacy calls to civicrm_error, unpack return #23634

Merged
merged 4 commits into from
May 31, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 30, 2022

The function can only return an array or a BAO object

Overview

Remove legacy calls to civicrm_error, unpack return

Before

createContact only ever returns

  • an array if a duplicate is found
  • a BAO object if not

But the code keeps 'checking out' the array with an api function that should not be used

In addition the array ALWAY contains ['error_message']['params'] so the handling for when it doesn't is unreachable

image

After

poof

Technical Details

Comments

I've continued on with the further cleanups this allows in #23635 - as it starts to get hard to read after this point

The function can only return an array or a BAO object
@civibot
Copy link

civibot bot commented May 30, 2022

(Standard links)

@civibot civibot bot added the master label May 30, 2022
@colemanw
Copy link
Member

Great cleanup!

@eileenmcnaughton
Copy link
Contributor Author

thanks @colemanw - it conflicts with #23626 - I'd really rather rebase this over than than the revese as there are several other PRs that are built on top of that...

@eileenmcnaughton
Copy link
Contributor Author

Oh well - this has passed - I'll rebase the other

@eileenmcnaughton eileenmcnaughton merged commit 7b9c5c9 into civicrm:master May 31, 2022
@eileenmcnaughton eileenmcnaughton deleted the import_unreach branch May 31, 2022 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants