Splitting this from the accursed #556022: When a text format is deleted, some modules (like text.module) don't update their data, even though we say they do.

Sun's update to Barry's patch is #http://drupal.org/node/556022#comment-3458204

The eventual patch here should include an implementation of text_text_format_delete() which invokes the field storage hook, since that prompted the original issue, unless that ends up being handled elsewhere.

CommentFileSizeAuthor
#5 drupal.entityfieldupdatequery.164.patch10.8 KBcatch

Comments

Status: Needs review » Needs work

The last submitted patch, drupal.entityfieldupdatequery.164.patch, failed testing.

chx’s picture

Version: 7.x-dev » 8.x-dev
chx’s picture

Note that this is 8.x material because if you want an update like this then you need to worry about inconsistencies in your data while the query runs, lock contention and who knows what else. We need to ponder on what sort of updates we want to be allowed too.

catch’s picture

Status: Needs work » Needs review
catch’s picture

StatusFileSize
new10.8 KB
sun’s picture

Version: 8.x-dev » 7.x-dev

@catch: Thanks!

@chx: Can you enlighten me? Why does db_update() not perform such checks normally then? The core implementation in field_sql_storage module performs just that. A db_update(). Can we agree on that we want to release and that we want to choose simplicity over perfectionism (like in this patch)?

Let's just make it work. No extra bells and whistles. If you need a more advanced EntityFieldUpdateQuery() in contrib, then let's simply make it swappable, by making functions like text_filter_format_delete() start with this instead:

  $query = field_attach_query_update();

whereas:

function field_attach_query_update() {
  $class = variable_get('entity_field_query_update_class', 'EntityFieldQueryUpdate');
  return new $class();
}
chx’s picture

Status: Needs review » Closed (won't fix)
  1. You have no idea, what so ever what generic field storage engines are capable of. Many will be readonly.
  2. Running a generic update like that is infeasible even with db_update due to lock contention issues. If you batch it then your site will be inconsistent while the batch runs.
  3. The patch totally disregards the trinity that EntityFieldQuery works with: entity, property and field. The consequences of updating entity conditions need a lot more thought. A real lot. What does it mean -- is it even meaningful? doable? -- to move something to another bundle?

I am sure I can find more things why this unresearched idea is unacceptable but I hope it's enough.

sun’s picture

Status: Closed (won't fix) » Needs review

You have no idea, what so ever what generic field storage engines are capable of. Many will be readonly.

If you store data that has to be updated in a read-only storage engine, then that's your fault.

Running a generic update like that is infeasible even with db_update due to lock contention issues.

Can you clarify? How do you suggest to execute the update query then?

The patch totally disregards the trinity that EntityFieldQuery works with: entity, property and field. The consequences of updating entity conditions need a lot more thought. A real lot. What does it mean -- is it even meaningful? doable? -- to move something to another bundle?

Sure, good points, the patch is just a starting point, and the points you're raising should be easily resolvable.

chx’s picture

Version: 7.x-dev » 8.x-dev

Totally D8 if not won't fix outright. You can not do such an update without firing the appropriate update hooks. I was wrong thinking a column update is doable. That's what bulk update API should be: batching / queuing a big bunch of update calls. And it needs to handle the case, even in small sites, yes, the problem that during the batch the site is totally inconsistent. This is way too complex for D7 now.

catch’s picture

Priority: Critical » Major

Downgrading all D8 criticals to major per http://drupal.org/node/45111

chx’s picture

Oh also -- doing anything but a batched / queued update is not possible because you need to fire the entity_update hook.

So the ideal API module doing this would store storage an EFQ query and queue the keys necessayr to be upgraded (careful to do in say pages of a hundreds or thousands) plus a callback which does the update (specified by the API consumer). It would not just make sure to do a queued update but also on entity load add the entity type + id to the EFQ to verify whether it needs updating (probably needs to store the finished results somehow) and do the update as well so that there is no inconsistency.

Anonymous’s picture

subscribe

quicksketch’s picture

Title: Missing EntityFieldUpdateQuery » Add EntityFieldUpdateQuery
Category: task » feature
Priority: Major » Normal
Status: Needs review » Needs work

Considering the response to this issue (vague demand, unclear solution) I'm moving this to a normal feature request. Major tasks are now holding up new development of Drupal core per the new policy at http://drupal.org/node/1201874.

chx’s picture

Title: Add EntityFieldUpdateQuery » Create a batched framework for entity updates
dawehner’s picture

Component: base system » entity system
Issue summary: View changes

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs work » Postponed (maintainer needs more info)
Issue tags: +stale-issue-cleanup

Thank you for sharing your idea for improving Drupal.

We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

Thanks!

smustgrave’s picture

wanted to bump 1 more time.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.