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

haza’s picture

Status: Postponed (maintainer needs more info) » Active

You can not hack core. (node.module)
And each time you hack core, a kitten dies...

         /\_/\
    ____/ o o \
  /~____  =ø= /
 (_______)__m_m)

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).

jsacksick’s picture

Status: Active » Closed (won't fix)

Can 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...

chefnelone’s picture

Status: Closed (won't fix) » Active

Your 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.

chefnelone’s picture

I 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.

jsacksick’s picture

Status: Active » Postponed (maintainer needs more info)

I'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?

chefnelone’s picture

Status: Active » Postponed (maintainer needs more info)

Please 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.

jsacksick’s picture

At 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 ?

chefnelone’s picture

I 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.

chefnelone’s picture

Status: Postponed (maintainer needs more info) » Fixed

Found the source of the problem: was the admin_language module. I just disabled it and everything is fine now.

Status: Fixed » Closed (fixed)

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

tchurch’s picture

I 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.

killua99’s picture

Ok,

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).

onelittleant’s picture

Thank 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.

onelittleant’s picture

Issue summary: View changes

typo

Lann’s picture

Issue summary: View changes

The solution in #11 worked for me as well.

khumbu’s picture

#11 did the trick for me as wel....

thomas.lobjoie’s picture

Clear your caches, and try again... worked for me...

michaellenahan’s picture

#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.

himanshupathak3’s picture

I found this issue was due to entitycache.

neetu morwani’s picture

@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.

nareshbw’s picture

I can also confirm this issue is due to entitycache module. Anyone have any solution for this.

himanshupathak3’s picture

Hello mates, uninstall entitycache and use memcache.

nwom’s picture

Did anyone solve the entitycache issue?

sahil gupta’s picture

You 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

souvik pal’s picture

#16 solved the problem for me! Thank you!

ykarthikvarma’s picture

#11 Did the trick. Thanks!