[ ContentBox v.2.0.0.00095] duplicate versions and duplicate active version

Hello,

we are having duplicate versions and duplicate active content (See screenshot). Any idea how to fix this?

Best regards,

Gunnar

Is this happening on multiple content items, or is it limited to one? If the latter, were there any errors that seemed to accompany this occurrence?

Thanks!

It’s on multiple items, the screenshot is from content store, but it has happened before on pages.
I didn’t any error but I will check the logs.

I guess the more important question is does it happen on ALL pages/contentstore items? If not, is there a common thread between the ones where this has happened?

What is the isActive flag set to on all the contentVersion records for that piece of content?

Looking at addNewContentVersion(), it seems that behavior would be possible if two versions were somehow allowed to both remain active. The activeContent property gets all versions that have isActive=1 and takes the first without sorting. If version 9 and 10 are both marked active, and it picks up 9, it would add 1 and insert 10 again.

Of course, we’d need to find how that the data got that way in the first place, but let’s at least determine if that data does exist and is causing the issue.

Run this query against your database to find all pieces of content with more than one active version. That might help us find the pattern.

select cv.fk_contentID, c.title, count(1)
from cb_contentVersion cv
inner join cb_content c on cv.fk_contentID = c.contentID
where cv.isActive = 1
group by cv.fk_contentID, c.title
having count(1) > 1

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Brad,

Without trying it, I am wondering if rolling back a version or two is then incrementing that version and not the next avail version, when editing the content again and publishing it.

before I deleted the content from the database both active versions had isactive=1

I ran the query, currently it doesn’t return any results.

It sounds like you already fixed the bad data so there’s no exceptions to report. I guess the good news is, that was the only bad conntent record.

You’ll need to remember exactly what changed on that content record and in what order so we can figure out how to duplicate it. Unfortunately, they may be harder now if the date created is gone. Next time, perhaps just inactivate all but one versions and make the version numbers unique.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com