Problem/Motivation

After upgrading to 3.x, all of my "Untracked" content types were changed to tracked, and given a Minimum to Keep value equal to what one of my content types had. Min Age will be set to None. This means that revisions of Untracked content might be unintentionally deleted as a result of upgrading if cron runs and deletes revisions.

Proposed resolution

Untracked content types should be preserved as Untracked.

Comments

solideogloria created an issue. See original summary.

solideogloria’s picture

Priority: Normal » Critical
Issue summary: View changes

Changing to Critical because of the potential for data loss

solideogloria’s picture

A potential workaround is to set the "How often should revision be deleted while cron runs?" setting to "Never" before upgrading, upgrade, set the configuration you want, then set the setting back to what you want it.

adriancid’s picture

Have you run the update?

solideogloria’s picture

Yes. If you don't, the configuration page does not even load.

I had a single content type set to 50 max revisions, with Cron set to run monthly. The other content types were set to Untracked.

After the upgrade on a test environment, ALL of my content types were set to keep only 50, with no minimum age, and to always delete. Cron was still set to run monthly.

Because of my configuration and data, it would not have been a big deal for me even if it had run. But I could see it being an issue for other users and configurations.

adriancid’s picture

Can you provide a patch for this?

solideogloria’s picture

I can look at it tomorrow. I don't think it will take too long, since I know it is in node_revision_delete_update_7300()

adriancid’s picture

I remember I create a hook_update for the config but the last time I used the 7.x-2.x version was 2 years ago, just check the hook_update to see if something is missing.

solideogloria’s picture

It wasn't checking the variables for whether the type is tracked. I compared the variables from 2.7 and 3.x. The only thing that needs to be changed is adding an "if" statement, because 3.x omits the types from the node_revision_delete_track variable if untracked.

I tested the new code on the site I saw the issue. I no longer see the issue, and all the types that are untracked stay untracked after the upgrade.

solideogloria’s picture

Status: Active » Needs review
solideogloria’s picture

Note that this could still be improved, because the variables are already loaded above to get the content type names. So maybe the variable values could be loaded at the same time?

Either way, I can't imagine there would be a large enough number of content types for this to make a difference, and the currently solution works and only has to run once.

adriancid’s picture

Status: Needs review » Fixed

thanks

adriancid’s picture

Status: Fixed » Closed (fixed)

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