Problem/Motivation

deploy.api.php is out of date: it documents hooks that have been removed/refactored or moved to the Entity Dependency API project.

Proposed resolution

Update deploy.api.php to match the current API as best as possible:

Hook Proposed change
hook_deploy_entity_dependencies It's now hook_entity_dependencies, no action needed.
hook_deploy_entity_dependencies_alter It's now hook_entity_dependencies_alter, move it: #2426633: Update entity_dependency.api.php
hook_deploy_entity_belongings It's now hook_entity_belongings, but it's currently not being called (commented out).
hook_deploy_entity_belongings_alter No current equivalent.
hook_deploy_field_dependencies It's now hook_field_entity_dependencies, API docs already exist in entity_dependency.
hook_deploy_field_dependency_alter It's now hook_field_entity_dependencies_alter, move it: #2426633: Update entity_dependency.api.php
hook_deploy_item_deployed It looks like this hook has been replaced by hook_deploy_operation_info to set up preprocess and postprocess callbacks.

Remaining tasks

Patch needs review.

User interface changes

n/a

API changes

n/a

Original report by @flyingkiki

I tried to implement hook_deploy_entity_dependencies_alter from my custom module, but seems there is no where called this hook in deploy module, and my implementation does not work at all.

CommentFileSizeAuthor
#4 deploy-1902774-4.patch5.43 KBstar-szr
#3 1902774-3.patch5.43 KBstar-szr

Comments

star-szr’s picture

Component: Code » Documentation
Assigned: Unassigned » star-szr
Issue summary: View changes

Yup, I ran into this too. I think this is as a result of the entity_dependency split. Use hook_entity_dependencies_alter(), the function signature is the same. It seems like this documentation can be tweaked and moved to the entity_dependency module's api.php file.

I will create a patch to remove these docs and other dead alter hooks from deploy.api.php and create another issue in the Entity Dependency queue to add these docs there.

bohemier’s picture

Thank you @Cottser

star-szr’s picture

Title: hook_deploy_entity_dependencies_alter does not work » Update deploy.api.php
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new5.43 KB

Thanks for the bump @bohemier, time to make good on my word. I updated the issue summary with a table to indicate where everything is heading, see #2426633: Update entity_dependency.api.php for the corresponding patch in the entity_dependency project that I will post shortly.

The docs for hook_deploy_operation_info() are a lot of guesswork on my part from digging through the code. @maintainers - if those docs are too far off, documenting that hook could be split up into its own issue to make this a simple removal issue to avoid the confusion that is happening.

star-szr’s picture

Issue summary: View changes
StatusFileSize
new5.43 KB

Issue summary tweak and better patch file name.

bohemier’s picture

Thanks for clarifying this Cottser. Didn't know about hook_deploy_operation_info, that's a nice find :)
You're right, this really api needs updating.

Best regards

star-szr’s picture

Assigned: star-szr » Unassigned
badjava’s picture

Status: Needs review » Reviewed & tested by the community

This looks good and we should commit this asap.

  • badjava committed db0212e on 7.x-2.x authored by Cottser
    Issue #1902774 by Cottser: Update deploy.api.php
    
  • skwashd committed edaa77b on 7.x-2.x
    Merge pull request #11 from dickolsson/1902774
    
    Update Deploy API docs d...
skwashd’s picture

Status: Reviewed & tested by the community » Fixed

Merged. Thanks for your work on this.

  • badjava committed db0212e on 8.x-1.x authored by Cottser
    Issue #1902774 by Cottser: Update deploy.api.php
    
  • skwashd committed edaa77b on 8.x-1.x
    Merge pull request #11 from dickolsson/1902774
    
    Update Deploy API docs d...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.