This content has been modified by another user, changes cannot be saved

funana - August 28, 2006 - 10:57
Project:Aggregator2
Version:HEAD
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

We have installed Agg2 on a fresh 4.7.3.

It works, but when we run cron or try to update the feeds it shows up the Error "This content has been modified by another user, changes cannot be saved" and doesnt leech the new items.

We unchecked the "update existing items" option, which didnt seem to work anyway.

Now it recieves some new items, but it still shows the Error.

I think it's very bad that Agg2 isnt supported by any Developers anymore... It is so great and if it would be merged with news_page.module it would be the rocker!!

Cant somebody pls. develop this wonderful module further?

Thanks a lot.

#1

funana - August 28, 2006 - 11:11

Sorry, I forget to tell that we allready patched Agg2 with this here: http://drupal.org/files/issues/agg2.patch
The patch didnt seem to change anything.
But we kept the patched Agg2 when we unchecked the "refresh items" option and run the cron.

#2

funana - August 28, 2006 - 14:28

It just leeched once. Now it's the same like before. No item updates...

Errors in entry from xyz feed: This content has been modified by another user, changes cannot be saved.

#3

zis - August 29, 2006 - 08:45

I have the same problem. I comes from the node_validate call on line ~1569 in aggregator.module

See node_validate checks for a couple of things. one of them is

<?php
if (isset($node->nid) && (node_last_changed($node->nid) > $_POST['edit']['changed'])) {
   
form_set_error('changed', t('This content has been modified by another user, changes cannot be saved.'));
  }
?>

line 1537 of node.module

I found a tweak that works but i think there must be another way to do it.. anyhow that's what i did:

in aggregator2.module, i added

<?php
$_POST
['edit']['changed'] = time();
?>
before the call for node_validate. for some reason the error started showing up soon after. So i did the following:

<?php
    $_POST
['edit']['changed'] = time() + 1000;
   
node_validate($feed);
   
$_POST['edit']['changed'] = time();
?>

It's working for now, but dunno if it's the best solution..

#4

zis - August 29, 2006 - 08:46

now it seems in the latest cvs version the node_validate call was removed... Try updating

#5

zis - August 29, 2006 - 08:51

Oops it seems the CVS update has been made to the 4.6 branch. What they did is just add a

<?php
$feed
->validated = TRUE;
?>
instead of the node_validate call.. But it's not the best solution..

#6

m3avrck - August 30, 2006 - 05:44

I have this same error too... hmm.

#7

gmak - September 1, 2006 - 08:15

same problem here as well...

#8

funana - September 4, 2006 - 13:23

Hi,

we used a combination of the work arounds as discribed above and it works now!
I attached the modified Agg2 Module we use on a production site, but usage is on your own risk.

Backup everything before you try it, and test it on your development environment first!

Im not a Drupal Developer, I just tried to do the best I could and it works now, I don't know if there are better ways to fix it...

If anyone got a better solution, pls. share your knowledge.

AttachmentSize
aggregator2.rar 79.28 KB

#9

RobRoy - September 4, 2006 - 16:53

Please post a patch as described here: http://drupal.org/diffandpatch

#10

zis - September 4, 2006 - 18:06
Status:active» needs review

Here's a patch. It's supposed to work fine. I tried it and it's working but it needs some testing...

AttachmentSize
aggregator2.module.simple.patch 761 bytes

#11

zis - September 4, 2006 - 18:13

Here's a patch. It's supposed to work fine. I tried it and it's working but it needs some testing...

AttachmentSize
aggregator2.module.simple_0.patch 761 bytes

#12

hanoii - September 6, 2006 - 17:52

the patch idea was ok but I think it was missplaced. I first tried the previous patch uploaded by ziz but this error keep happeninig. I guess this was a validation added on the newest drupal core, because I recall this not happening on the previous versions.

Anyway, I attach the patch against the lastest -cvs.tar.gz package of the module (v1.43 cvs version of this file). Hope this helps.

a.=

AttachmentSize
aggregator2.module_3.patch 407 bytes

#13

hanoii - September 6, 2006 - 21:11

Ok.. what I talk about previously was wrong.. the fix was correctly placed, althouth that was for fixing the validation for the feed node type. I aslo found that the feed_item node types were failing too, so I added that same workaround on another place of the file.

I also found another error, which I might post on another issue, thus when the module tries to update an already stored item, it loads the taxonomy information twice, and because of t his warnings of duplicte keys on the taxonomy table appear on the administration page.

I found why this was happening. It is documented on the code that node_load() does not load the taxonomy information, so the module loads it itself, but node_load does include that information.

The patch I am attaching has the previous workaround for the validation error and also this error fixed.

Hope this helps, the patch was made agains the same aggregator2.module file I mention on my previous post.
a.=

AttachmentSize
aggregator2.module_4.patch 1.61 KB

#14

zis - September 6, 2006 - 21:57

Hanoii, for the duplicate entries bug, there's a patch that's working and ready to be comitted: http://drupal.org/node/81085

#15

jt6919 - September 8, 2006 - 16:24

it's great to have the patches of aggregator2, but I believe the new version (leech_news) will replace it.

I got email from the assigned developer ("ahwayakchih") of aggregator2 and the author or leech_news and he is coming back Sept 18!! Just want a little over a week for development to begin again and the bugs to get worked out in a brand new version of leech_news...

#16

funana - September 8, 2006 - 21:51

wow! Thats really great news! I was just talking about that with a friend today: "Oh, it's so bad that ahwayakchih doesnt support the module anymore".

great!

#17

monkeythug - September 18, 2006 - 23:00

Hi, just applied the patch (aggregator2.module_4.patch) and it seems to work OK for me.

Small point - it looks like the patch is a reverse patch? Is this intentional? (It might be the norm for drupal patches but my very brief skim of the documentation suggests not ... ;-)

Cheers,

David.

#18

spazio - October 25, 2006 - 10:24

Would it be possible to attach the patched module here, so I could download it as well?

Thank you!

Mario

#19

orionvortex - October 26, 2006 - 14:51

Actually, could someone please post this module with this patch and the patch that will allow categorization of feeds. I was able to apply the categorization of feeds patch http://drupal.org/node/61474 but I couldn't get this patch to work after I applied that patch.

 
 

Drupal is a registered trademark of Dries Buytaert.