Hi, I have updated from 1.x to 2.x-dev.
The configurations of "Add the CSS on specific pages" and all the page URLs, went lost.
Also when i add a new CSS file I get this error:
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'rule_conditions' doesn't have a default value: INSERT INTO {css_injector_rule} (name, admin_description, css, media, preprocess, inline, page_visibility, page_visibility_pages) 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); Array ( [:db_insert_placeholder_0] => www [:db_insert_placeholder_1] => ww [:db_insert_placeholder_2] => ww [:db_insert_placeholder_3] => all [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => ) in drupal_write_record() ...
Also, when I try to re-save a CSS file with brackets in the machine name, i got this error:
Illegal characters found in the friendly name, please remove them.
but the field is disabled and i can't edit it.
Could this be all related to the one CSS file illegal characters? I have deleted it and cleared all caches, but the problems still persist.
Comments
Comment #1
kreynen CreditAttribution: kreynen commentedCan you attach an export of your css_injector table?
Comment #2
maustyle CreditAttribution: maustyle commentedI can only find this table:
css_injector_rule
Comment #3
kreynen CreditAttribution: kreynen commentedYes. Please export that table.
Comment #4
bagelche CreditAttribution: bagelche commentedI came here today to post the same PDOException error. I've checked with a couple of others users of 2.x who report they have created new rules successfully, but I am unable to.
Comment #5
kreynen CreditAttribution: kreynen commentedThe issue only impacts upgraded sites. I thought the problem was in the data (or lack of data) in the rule_conditions field of a specific rule, but it's at the db level.
In the 1.x version of css_injector a value for rule_conditions was required at the table level...
http://cgit.drupalcode.org/css_injector/tree/css_injector.install?h=7.x-...
In the 2.x branch, the logic of that field is moved to page_visibility and page_visibility_pages...
http://cgit.drupalcode.org/css_injector/tree/css_injector.install?h=7.x-...
Currently the values from rule_conditions aren't migrated in an update_hook and the field remains in the table causing this error.
Expect a commit to fix this in a few minutes.
Comment #7
kreynen CreditAttribution: kreynen commentedComment #8
bagelche CreditAttribution: bagelche commentedI just installed and did a few quick tests with kreynen's fix on my existing test environment. It has resolved this issue for me. Thank you!
Comment #9
maustyle CreditAttribution: maustyle commentedHere is my css_injector_rule (simplified):
Comment #10
kreynen CreditAttribution: kreynen commentedI tested the updated dev snapshot with this @maustyle's table and I was able to add a new rule after running update.php. Like @bagelche, the update fixed the issue for me.
If you are still having this issue after updating to the most recent dev snapshot, please reopen the issue.