Forum uninstall has:

field_purge_batch(10);

which confused me wondering why it only deletes 10 forums. So I went on IRC and webchick says that means it deletes 10 at a time. But the top of field_purge_batch says:

This function will purge deleted field data on up to a specified maximum number of entities and then return.

which sounds like it only deletes the number of items sent in to it and that's it. Seems like that should be re-worded to explain that it deletes X at a time until they are all gone rather than just deleting X total.

Michelle

CommentFileSizeAuthor
#2 drupal-api-1395974-2.patch1.19 KBwebbykat

Comments

webbykat’s picture

Agreed - a small wording change would make this clearer for newbies. The current line at the field_purge_batch documentation is "This function will purge deleted field data on up to a specified maximum number of entities and then return." I suggest changing to "This function will purge deleted field data in batches. The batch size is defined as an argument to the function, and once each batch is finished, it continues with the next until all have completed."

webbykat’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

Patch with wording change attached. Final text:

* This function will purge deleted field data in batches. The batch size
* is defined as an argument to the function, and once each batch is finished,
* it continues with the next batch until all have completed. If a deleted field
* instance with no remaining data records is found, the instance itself will
* be purged. If a deleted field with no remaining field instances is found, the
* field itself will be purged.

webbykat’s picture

Issue tags: +Documentation
michelle’s picture

That is tons better. RTBC from me but let's give others a chance to chime in since you just posted it an hour or so ago. :)

rdrh555’s picture

Status: Needs review » Reviewed & tested by the community

@Michelle, I agree, tons better. This batch removal process is quite clear now.

xjm’s picture

Issue tags: +Needs backport to D7

This looks good for backport as well.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome work! Committed and pushed to 8.x and 7.x.

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