In a product display after saving a product variation if I hit the Save button (for the product display) I get this error and the product is not saved:
The content on this page has either been modified by another user, or you have already submitted modifications using this form. As a result, your changes cannot be saved.
To get rid of this message I implemented a dirty solution: I commented these lines at mysite/modules/node/node.module
if (isset($node->nid) && (node_last_changed($node->nid) > $node->changed)) {
form_set_error('changed', t('The content on this page has either been modified by another user, or you have already submitted modifications using this form. As a result, your changes cannot be saved.'));
}
How can I solve this?
Comments
Comment #1
hazaYou can not hack core. (node.module)
And each time you hack core, a kitten dies...
Don't let kitten die...
Are you sure that you don't a other tab open on the same page ? Or someone else changed the product ? That happen in those cases. (and that need to happen in those cases).
Comment #2
jsacksick commentedCan you tell me what is the point of creating an issue in the Commerce Kickstart issue queue for a non issue caused by a useful check coming from a Drupal core module ?
Commenting those lines is definetly not the solution... The message is pretty clear, either somebody used your account or you opened the same node in an other tab...
Comment #3
chefnelone commentedYour are right. I will revert those changes as soon as finish adding products to this site.
I'm 100% sure there is no other tab open on the same page. This only happens when I save the variation and then I save the product display.
Comment #4
chefnelone commentedI post this here because this only happens when I save a Product variation (provided for this distribution). No one is editing the same node nor it is opened in other tab.
Comment #5
jsacksick commentedI'm currently unable to reproduce your issue unless you give me more details about it...
Did you add additional contrib modules ? Can you provide the exact steps to be able to reproduce it ? Eventually a screencast or something?
Comment #6
chefnelone commentedPlease take look a this screencast: http://www.screencast.com/t/6VXQkU0U
Yes, I have additional modules enabled.
I've made sure not other tab, window or other browser was open at the moment I fired the video.
Comment #7
jsacksick commentedAt some point around 1:00, I don't know if you've noticed but it seems that when you're first trying to remove the product variation image, everything is in spanish, when you click on "Emilinar", the node is being saved, then everything switches to English, I don't know what's happening there but you shouldn't have to click two times to be able to remove your image. Since when the bug is happening, did you enable a new module lately ?
Comment #8
chefnelone commentedI had also noticed that, but I thought it was normal...sort of "double check".
I'll check on this.
Thanks.
Thing is that I have enabled many contributed modules, disabling them one per one to find the source of the problem will be a massive work for me. For this reason I would like to leave this as last alternative.
Comment #9
chefnelone commentedFound the source of the problem: was the admin_language module. I just disabled it and everything is fine now.
Comment #11
tchurch commentedI don't want to open old issues but someone searching for this problem might like to know about my solution.
I had exactly the same issue. No-one else was editing the node at the time.
I don't have product variation images but product display images.
I wanted to remove an old image and upload a new one (I had dummy images in there before, to get the layouts correct).
I clicked "remove" to remove the old image and got a green message box "...has been updated" but I hadn't even saved it yet.
I tried to click "save" and got the message we all see.
I checked in my node table and found that the changed value had been updated even though nothing had been saved!
I looked in my log files and found this:
[Sat Apr 27 11:29:32 2013] [error] [client 86.155.81.95] PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0, referer: http://www.example.com/node/71/edit
Yes, this product display has over 1000 variations attached to it (that was an interesting challenge to add them all as the mass creation module doesn't work properly).
I set the value to 1500 in my php.ini file and it all works correctly now.
Hope this helps someone.
Comment #12
killua99 commentedOk,
If you get this error and you use admin_language and you don't have the PHP Warning that @tchurch mention then maybe you have to do this.
#1337558-3: Admin language causes file uploads to save node
They made a patch and is current in the dev branch, you have to update the module (admin_language).
Comment #13
onelittleant commentedThank you! Thank you! Thank you!
This was terribly difficult to debug but #11 was the solution for me. We have a content type with some large field_collection fields on it, and when enough values were added to the fields collection and other fields, our node edit forms started exceeding the max_input_vars limit in PHP.
Comment #13.0
onelittleant commentedtypo
Comment #14
Lann commentedThe solution in #11 worked for me as well.
Comment #15
khumbu commented#11 did the trick for me as wel....
Comment #16
thomas.lobjoie commentedClear your caches, and try again... worked for me...
Comment #17
michaellenahan commented#16 thank you. Clearing cache helped in our case as well.
The error comes from here:
https://api.drupal.org/api/drupal/modules%21node%21node.module/function/...
https://api.drupal.org/api/drupal/modules%21node%21node.module/function/...
The value in the node table in the database for 'changed' was a day ago, so I'm guessing that the cached value may have been incorrect - don't know how that may have occurred, though.
Comment #18
himanshupathak3 commentedI found this issue was due to entitycache.
Comment #19
neetu morwani commented@himanshupathak3 I see your last comment. While debugging, I found out that the cause of this is the old $node object being passed to node_validate. This could be because of entitycache. Were you able to resolve this. If yes, then how?
Thanks.
Comment #20
nareshbw commentedI can also confirm this issue is due to entitycache module. Anyone have any solution for this.
Comment #21
himanshupathak3 commentedHello mates, uninstall entitycache and use memcache.
Comment #22
nwom commentedDid anyone solve the entitycache issue?
Comment #23
sahil gupta commentedYou can use a module to control this Maximum Input Variable Limit. PHP Runtime Configurator module provides many options to configure without changing your php.ini file and restart Apache.
You can configure following parameters:
- File Upload Limit
- Memory Limit
- Maximum Execution Time Limit
- Maximum Input Variable Limit
Comment #24
souvik pal commented#16 solved the problem for me! Thank you!
Comment #25
ykarthikvarma commented#11 Did the trick. Thanks!