| Project: | CSS Injector |
| Version: | 6.x-1.3 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Regardless of what values I enter, whenever I attempt to create a new rule I get this message:
user warning: Field 'file_path' doesn't have a default value query: INSERT INTO css_injector_rule (title, rule_type, rule_conditions, media, preprocess) VALUES ('test3', 0, '', 'all', 0) in [path-to-Drupal-install]\includes\common.inc on line 3318.
The VALUES part of the message changes but everything else stays the same. Beneath this, a message in green appears saying "Your CSS injection rule was saved," but below that, where the list of rules should appear, it says "No CSS injection rules have been set up yet."
The css_injector_rule table is unpopulated. I did notice that a css_injector_.css file gets added to my 'files' directory and its contents reflect the css I attempted to add when attempting to create the new rule. This file gets overwritten every time I attempt to create a new rule.
I am running Drupal 6.4 on Windows Server 2003; haven't tried it on previous versions of Drupal.
Comments
#1
I modified the css_injector_rule table to accept NULL values in its file_path field using the following...
ALTER TABLE `[MY_DRUPAL_DATABASE]`.`css_injector_rule` MODIFY COLUMN `file_path` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci;... and at first glance the module seems to be working now. Don't know what side effects this will have, though.
#2
when working with a Postgres back-end, the create fails with a big red error message saying that the "not null" constraint on css_injector_rule was violated. I fixed it by editing css_injector.install and making file_path nullable.
(Oh, and I get the green message saying the rule was created, even when it wasn't.)
#3
This fixed it for me on pgsql. Not sure which is cleaner.
#4
same problem with Drupal 6.2 & 6.4 database MySQL
#5
After I´ve looked to code, from I understood, the problem is in table definition, 'file_path' column must accept null values.
When form is being submited is maked a first save without file_path defined. Only at second save is 'file_path' fullfilled.