Then the next bean block I try and save results in a PDO Exception error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'vid': INSERT INTO {bean} (vid, delta, label, title, type, view_mode, data, uid, created, changed) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => ljkhlkjkhjgjkhg [:db_insert_placeholder_2] => l;jkhlkjkhjgjkhg [:db_insert_placeholder_3] => l;kjl;kjjkhghjkg [:db_insert_placeholder_4] => blat [:db_insert_placeholder_5] => default [:db_insert_placeholder_6] => a:1:{s:9:"view_mode";s:7:"default";} [:db_insert_placeholder_7] => 1 [:db_insert_placeholder_8] => 1363237916 [:db_insert_placeholder_9] => 1363237916 ) in drupal_write_record() (line 7106 of /[mysite]/includes/common.inc).
Comments
Comment #1
saltednutCan you reproduce this error using the latest dev?
Comment #2
marblegravy commentedJust tried again with a fresh install and the dev version and the steps to reproduce above still apply and I can't create bean blocks. The first one results in a page not found, the second results in the PDO error.
This time I didn't use a common field (I used field_body the first time in #1) name and just created an image field. So that's not where the issue was coming from.
The PDO error at the end is exactly the same as the one above.
Does it make a difference that I'm using an installation profile? I might try it out with a vanilla Drupal install and see if I still get the same issue.
Comment #3
saltednutIt COULD make a difference. Does the install profile patch core?
Comment #4
marblegravy commentedThe profile doesn't touch core. It's just the way we deploy our stuff.
OK, So I've tried again with a fresh everything (still in our profile) and I've got the following notes:
When Bean is installed it creates the bean, bean_revision and bean_type tables in the db.
I create a bean type and it appears in the db ok.
The first time I create a bean, a db entry is created in the bean table (to confuse things, I called the bean 'Title' but I did not create any other fields):
The bean_revision table is still empty.
however, the result page still could not be found:
The requested page "/block/title/view" could not be found.Going back to the block content page at /admin/content/blocks, it claims there are no blocks.
Trying to create a new block for a second time, we get the PDO exception:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'vid': INSERT INTO {bean} (vid, delta, label, title, type, view_mode, data, uid, created, changed) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => second [:db_insert_placeholder_2] => Second [:db_insert_placeholder_3] => Second block [:db_insert_placeholder_4] => content [:db_insert_placeholder_5] => default [:db_insert_placeholder_6] => a:1:{s:9:"view_mode";s:7:"default";} [:db_insert_placeholder_7] => 1 [:db_insert_placeholder_8] => 1363743238 [:db_insert_placeholder_9] => 1363743238 ) in drupal_write_record() (line 7106 of [mysite]/includes/common.inc).Checking the db, there's still the initial row in the bean table, but obviously no sign of the second one that resulted in the PDO exception.
If I delete the row in the bean table, I can reproduce the process above every time.
So it seems that for some reason, my site isn't reading the beans table correctly. But I've got no idea where to look for the problem. Any ideas?
Comment #5
marblegravy commentedSuccess!
I just started from scratch again but installed the dev builds of both bean and entity API. So I am currently running bean 7.x-1.1+10-dev and Entity API 7.x-1.0+2-dev and it works!
Looking at the bean table now I can see both the first and second bean I created, with the only real difference being that the value in vid is now non-zero for bid 1:
So not knowing a great deal about the inner workings of Bean or the Entity API, I suspect that might be a clue?
Interestingly, I continued to add a bunch more beans and each time the bid and vid values incremented by two.
Final thing to note is that the bean_revision table is also now being populated when new beans are created where previously they were not.
So my immediate issue is now fixed, so unless you think this needs further investigation I'm happy to mark is as resolved.
Comment #6
saltednutI'm going to close this since we can't reproduce it.
I would suggest filing a new issue regarding:
That seems like a separate issue.
Comment #7
john bickar commentedI realize this issue is closed, but the problem here is that you need a newer version of entity than 1.0-rc3 (one that supports revisions). I'm not sure exactly when that went in, but it was in there by 1.0 (and current version is 1.1)
Comment #8
davidwbarratt commentedI'm experiencing this problem as well, perhaps Bean should specify the version of Entity API that is required in the .info file?
https://www.drupal.org/node/542202#dependencies
Thanks!
Comment #9
davidwbarratt commentedThe attached patch will stop the user from enabling Bean until they have a version of Entity API that is high enough to use. In my testing, 7.x-1.0 was the minimum version that can be used to avoid this problem.
Comment #10
indytechcook commentedThanks, pushed to 7.x-1.x