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

dev/core#3514 Add interface to allow extensions that deal with imports to cope with 5.51 #23893

Merged
merged 1 commit into from
Jun 29, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jun 28, 2022

Overview

I have to update csvImporter for 5.51 & there is also AdvImport & they need to be able to use the userJob table - this allows them to define interfaces

(Depends: #23888)

Before

Core UserJob table has a hard-coded list of job-types

After

Extensions can declare UserJob interfaces

Technical Details

The required functions are
public static function getUserJobInfo(): array;
public static function runJob(\CRM_Queue_TaskContext $taskContext, int $userJobID, int $limit, int $offset): bool;

Comments

https://lab.civicrm.org/dev/core/-/issues/3514

@civibot
Copy link

civibot bot commented Jun 28, 2022

(Standard links)

@civibot civibot bot added the 5.51 label Jun 28, 2022
@eileenmcnaughton eileenmcnaughton force-pushed the user_two branch 3 times, most recently from e387b0d to 7a8a38c Compare June 28, 2022 22:38
@eileenmcnaughton eileenmcnaughton changed the title [WIP] Add interface to allow extensions that deal with imports to cope with 5.51 Add interface to allow extensions that deal with imports to cope with 5.51 Jun 28, 2022
@totten
Copy link
Member

totten commented Jun 29, 2022

I haven't tested the csvimporter, but I did include this patch while doing some r-run aimed at #23888 ("Import Contacts", "Import Activities", "Import Custom Data"). They all appeared to work as before. 👍

I suspect there is some test-coverage (eg the unit-tests for importer probably have an implicit reliance on this).

If it's working for @eileenmcnaughton on csvimporter, then +1 for merge. We just need to get the dependency #23888 first.

@eileenmcnaughton
Copy link
Contributor Author

@totten - I'm not expecting it to work with csvimporter - I'm expecting it to be possible to do a big fix-up on csvimporter so it does work - but at least with this merged I can do that

@totten
Copy link
Member

totten commented Jun 29, 2022

Ah. In that case, I've done trial run with a dummy extension: https://gist.github.com/totten/377b3d84a8f948c554dba18a4b2ad850

With the dummy extension, I was able to alternately inspect the UserJob list and toggle the foojob extension.

## Inspecting
cv api4 UserJob.getFields '{"loadOptions":true}' +w name=job_type
cv ev 'return CRM_Core_BAO_UserJob::getTypes();'

## Toggling
cv en foojob
cv dis foojob

That seemed to work. (Which is expected -- given that there's test-coverage for scanning interfaces generally, and given that these specific interfaces are working in core.)

@eileenmcnaughton
Copy link
Contributor Author

OK cool - but we need to wait two hours for the other test to pass now I think & then rebase this ?

@eileenmcnaughton
Copy link
Contributor Author

eileenmcnaughton commented Jun 29, 2022

OK - the other finished tests so I merged it and rebased it out of this - which I think was all this was waiting on to get MOP based on the above

@eileenmcnaughton eileenmcnaughton changed the title Add interface to allow extensions that deal with imports to cope with 5.51 dev/core#3514 Add interface to allow extensions that deal with imports to cope with 5.51 Jun 29, 2022
@eileenmcnaughton eileenmcnaughton merged commit a8cbe71 into civicrm:5.51 Jun 29, 2022
@eileenmcnaughton eileenmcnaughton deleted the user_two branch June 29, 2022 13:03
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