Compare versions alert appearing in edit mode ( more than 1)

Permalink 58 50 Browser Info Environment
i have been working with concrete5 framework for 1 month. It was very good. But few days ago, i'm encountering an alert of Concrete5 (Compare versions below the address bar). It is very annoying that i required to close it everytime it get into edit mode. Eventhough i click on the compare version, it is showing nothing.
Please help me to solve this problem.
It would help a lot of people who are facing the similar problem

1 Attachment

Status: New
Remo replied on at Permalink Reply
I'm afraid, never had such a problem. Does this happen on several sites? Is the problem theme-dependent? Does it happen if you switch to a different theme?
FrankFrey replied on at Permalink Reply
I have got the same problem. The compare version alerts begin to appear on a page in edit mode as soon as I go on "edit > versions". (I did this just out of couriosity, but now I can not get rid of these alerts again. I would be glad if someone could help!
Justin1978 replied on at Permalink Reply
I can confirm the same problem several times. This is the second installation where this occurs. I've had the problem in version and version I think it has something to do with an exception during an update of page-properties but I'm not sure. When you extend a page-event for 'on_page_update' or 'on_page_version_approve' and there's an error in your code this can throw an exception and subsequently Concrete-code that might be executed after the event is dispatched will not be executed and cause a problem with page-versioning. But this is only a theory. I do agree it's very annoying and runnnig the job for cleaning up old page-versions does not work. I finally just threw the page away and made a new one. But this will be a problem if it occurs on the homepage.
FrankFrey replied on at Permalink Reply
It does appear on the homepage though. Is there a way to replace the homepage with a new page?
Justin1978 replied on at Permalink Reply
I have never done that before. The problem is that the homepage is the root of your website, you can't move it or delete it. I dug around a bit more yesterday and I think it has something to do with a workflow-request. Workflow-requests have something to do with pending tasks like a page-approval. With this in mind I truncated (emptied) the following tables in the database : Workflowprogress and WorkflowRequestObjects. This worked and the alerts dissappeared. I'm not a fan of messing around with the database cause you bypass the system this way and could break something but I'm sure in this case it's pretty safe. Make a backup of your database first before you try this and test your website after the changes to see if all still performs as expected. It worked for me. Let me know if this solved your problem for other people monitoring this post.
FrankFrey replied on at Permalink Reply
Dear Justin,

thank you so much! It worked!
fregas replied on at Permalink Reply
We're having the same problem at work.

We removed those workflow records, but then the entire edit bar at the top of the screen blanked out so nothing was editable. When we put the records back, we got the multiple compare buttons again.

Any help is appreciated!

Justin1978 replied on at Permalink Reply
Hi Craig, appologies for my late response, I was away for a month and just returned. Editbars blanking out usually occur when an exception is thrown and this is printed within the Javascript or HTML for the editbar thus creating non-valid JS and/or HTML. That's why the editbar is probably blank and this means my solution obviously didn't work. It could however have something to do with cache. Did you try emptying this? Otherwise you could check Firebug for the exception and see if you can fix this. Otherwise I'm not sure what the cause could be and it's hard the reproduce the problem. I am actually hoping the Concrete5 developers could share some light on the subject given the fact that we know it has something to do with workflowrequests.
ScapS replied on at Permalink Reply
Worked for me!
dsw528 replied on at Permalink Reply 1 Attachment
I am having the same issue, and it's becoming quite a nuisance.
It would be very nice to fix this bug. I attached a screenshot of what it looks like for me as well.

Has anyone come up with a solution for this yet?
yolk replied on at Permalink Reply
I removed the two rows that were in the table named WorkflowRequestObjects, backup your database before doing that.

And then this errored, because there was no checking in a core C5 file.

So I edited a core C5 file in concrete/tools/page_controls_menu_js.php, backup this file before editing it.

Around line 259 there is this

$wrk = $wr->getWorkflowRequestPermissionKeyObject();

This will fail as $wr is not an object, so change line 259 to

if($workFlowRequest instanceof WorkFlowRequest))
$wrk = $wr->getWorkflowRequestPermissionKeyObject();

This new code will check if $wr is present before racing ahead and trying to use it as an object.
Justin1978 replied on at Permalink Reply
That's is not a good practice. By removing the two records you basically corrupted the data, that's why you had to adjust something in the core while in fact it's not a coding error. The danger of doing this is that it can create a chain of these errors.

I would like to recommend that if you implement code like this you do it like this :

if($workFlowRequest instanceof WorkFlowRequest)){
$workFlowRequestionPermissionKey = $workflowRequest->getWorkflowRequestPermissionKeyObject();

It's stricter and more readable.

I'm just hoping they will fix this soon.
yolk replied on at Permalink Reply
Good point.

I don't like hacking the core but seen as there is no proposed fix it is better than having moaning a client.
Justin1978 replied on at Permalink Reply
Very true, I agree :)
strongeye replied on at Permalink Reply
I'm in the same boat with this error appearing. It seems like the gist of this thread is that changing core code is a hack, and deleting db records could be bad news, so I'm a bit reluctant to do either, but will likely delete records in db after backing it up.

I just wanted to verify that this bug still exists and I see exactly the same thing as other screen shots.
ConcreteConversion replied on at Permalink Reply
Found the same thing in 5.6.2RC. It started after I added a Page List block and selected to display more than 200 items. The whole block disappeared, after that Edit mode didn't work, and those alerts are appearing when I try to revert to an older version or change properties from Dashboard.
ConcreteConversion replied on at Permalink Reply
Instead of hacking the core, deleting all references, not just the workflow objects, is probably better. This (Mysql specific) statement does the trick:

DELETE WorkflowRequestObjects, WorkflowProgress, PageWorkflowProgress
FROM PageWorkflowProgress
INNER JOIN WorkflowProgress ON PageWorkflowProgress.wpID = WorkflowProgress.wpID
INNER JOIN WorkflowRequestObjects ON WorkflowProgress.wrID = WorkflowRequestObjects.wrID
WHERE PageWorkflowProgress.`cID` = PAGE_CID;

Before executing, go to the PageWorkflowProgress table and see what cID is causing the problem (the Collections table can also be helpful if you know the url path). Put it in PAGE_CID in the query above.
mesuva replied on at Permalink Reply
I've had this bug pop up on a site - it happened on the home page. No matter what I did with versions the 'Compare Versions' blue strip wouldn't go away. There were no workflows in place.

My solution to this wasn't to delete any records, but to find in the WorkflowProcess table the corresponding records and change their wpIsCompleted value to 1. This made these alerts go away and hasn't caused any issues (so far!). Other comments in this thread suggest removing database records - doing so does break editing I found.

I was able to find the records to adjust by hovering over the 'Compare Versions' button and taking note of the ID in the URL they pointed to.

I've never seen this on any other site and I think this was caused by the server being a bit flakey - it would die randomly on some requests and I reckon it caused this bug by half saving a page update.
jero replied on at Permalink Reply
I just had a similar experience in a site.

Following @mesuva's example. I set all the WorkflowProgress.wpIsCompleted=1 and it went away. No workflows - never used them.

Upgraded to - same issue.

It seems to happen as a result of using changing a blocks design to edit the background colour (design and custom template). I'm getting a less error about an undefined variable and once that's happened, the blue panel appears.
moma0503 replied on at Permalink Reply
This worked for me. Thanks.
DavidKSchneider replied on at Permalink Reply 1 Attachment
We keep collecting alert trash on the home page. Gone through all of the workflow and review processes - they never go away. See the picture. This happens with any changes to the home page - another alert popup appears.

concrete5 Environment Information

# concrete5 Version

# concrete5 Packages
Database Case Sensitivity Migration (1.1.2), Google Map (Premium) (2.1).

# concrete5 Overrides
blocks/autonav, blocks/slideshow, blocks/content, elements/block_area_footer.php, themes/ddelectrical

# Server Software

# Server API

# PHP Version

# PHP Extensions
bcmath, bz2, calendar, cgi, ctype, curl, date, dom, exif, ffmpeg, filter, ftp, gd, gettext, hash, iconv, imagick, imap, ionCube Loader, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, posix, pspell, Reflection, session, SimpleXML, soap, sockets, SPL, SQLite, ssh2, standard, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend Optimizer, zip, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 64M
post_max_size - 12M
safe_mode - Off
safe_mode_exec_dir - <i>no value</i>
safe_mode_gid - Off
safe_mode_include_dir - <i>no value</i>
sql.safe_mode - Off
upload_max_filesize - 10M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
pcre.backtrack_limit - 100000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17