Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If i try to add a feed in "admin/content/aggregator/add/feed" i get the following error. The feed is not added, but reported as added. This is a from new test installation.
user warning: Field 'description' doesn't have a default value query: INSERT INTO aggregator_feed (fid, title, url, refresh, block) VALUES (1, 'Drupal.org', 'http://drupal.org/node/feed', 604800, 5) in C:\Inetpub\wwwroot\drupal5\includes\database.mysqli.inc on line 151.
Comment | File | Size | Author |
---|---|---|---|
#11 | description.patch | 2.91 KB | enobrev |
Comments
Comment #1
xeladrane CreditAttribution: xeladrane commentedI get this same problem.
It seems to be a bug in Drupal 5.5, I don't think I had this problem with 5.3 although I may have reconfigured MySQL since then, and it is related to the MySQL implementation.
If you run MySQL in Strict mode, then since the aggregator.install file doesn't include a default for the description field (or the image field), the save function for adding a feed fails. See the following issue:
http://drupal.org/node/84078
Comment #2
berenErchamion CreditAttribution: berenErchamion commentedI get the same error when using:
Drupal 5.3
GD library bundled (2.0.34 compatible)
MySQL database 5.0.45
PHP 5.2.5
Unicode library Standard PHP
Web server Apache/2.2.4 (Win32) PHP/5.2.5
I'm running this on a clean install on Win32.
beren
Comment #3
berenErchamion CreditAttribution: berenErchamion commentedI updated to drupal 5.5 and I still get the same error:
user warning: Field 'description' doesn't have a default value query: INSERT INTO aggregator_feed (fid, title, url, refresh, block) VALUES (3, 'Tarn Aeluin', 'http://tarnaeluin.wordpress.com/feed/', 3600, 5) in C:\Apache\htdocs\drupal-5.3\includes\database.mysql.inc on line 172.
Any idea what the problem might be?
beren
Comment #4
berenErchamion CreditAttribution: berenErchamion commentedI modified the code to add a default value for description and then tried the function again from the admin panel. Now I get the same error, but instead of description now I get an error on the image column. I looked into the database and these columns are definitely in the database so something seems funky. I'm using the Eclipse database tools, which seem to be pretty inept and not capable of really seeing too much about the settings at the column level.
Using the MySQL prompt and a show columns command I can see that there is no default set for a bunch of columns that are not in the form on the web page:
mysql> show columns from aggregator_feed;
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------ --+------+-----+---------+----------------+
| fid | int(11) | NO | PRI | NULL | auto_increment |
| title | varchar(255) | NO | UNI | | |
| url | varchar(255) | NO | UNI | | |
| refresh | int(11) | NO | | 0 | |
| checked | int(11) | NO | | 0 | |
| link | varchar(255) | NO | | | |
| description | longtext | NO | | | |
| image | longtext | NO | | | |
| etag | varchar(255) | NO | | | |
| modified | int(11) | NO | | 0 | |
| block | tinyint(4) | NO | | 0 | |
+-------------+--------------+------+-----+---------+----------------+
11 rows in set (0.25 sec)
beren
Comment #5
berenErchamion CreditAttribution: berenErchamion commentedWell I fixed this issue by manually going into MySQL and setting default values on the columns that did not have one. You can do this with this command:
alter table aggregator_feed alter column link set default 'NA'; commit;
You need to be logged into your Drupal database with the right pivs...
Once I did this then I could add feeds and see them getting retrieved and stuff.
beren erchamion
http://tarnaeluin.wordpress.com/
Comment #6
nsk CreditAttribution: nsk commentedI think this is fixed in 6. I can't reproduce it with 5.5 (mysql), and I tried feeds without description. Can someone include more info, not only about your mysql version, but specifically about its config (you run under strict mode maybe?).
Comment #7
hass CreditAttribution: hass commentedI have mysql 5 in strict mode
Comment #8
berenErchamion CreditAttribution: berenErchamion commentedI'm using a completely default install of MySQL on Win32. Here's my sql-mode:
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
All my version info is above.
beren
Comment #9
Andrey Zakharov CreditAttribution: Andrey Zakharov commentedALTER TABLE `aggregator_feed` CHANGE `description` `description` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci
NULL
Comment #10
Andrey Zakharov CreditAttribution: Andrey Zakharov commentedALTER TABLE `aggregator_feed` CHANGE `image` `image` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci
NULL
its heal
Comment #11
enobrev CreditAttribution: enobrev commentedThe problem is when mysql is set to strict mode. It seems you cannot set a default value on a text / blob. AND, since there is no default value, and the query isn't setting a value, mysql chokes up. To fix this issue, you need to add the description and image fields to the update and insert queries in the aggregator_save_feed function in modules/aggregator/aggregator.module
Mark
update: posting patch.
Comment #12
computerwill CreditAttribution: computerwill commentedThanks for the patch! Evidently, this issue still exists in 5.7 stable, except it has moved down to line 172. I'm also running on Windows XP, PHP 5.2.5, MySQL 5.0.45 in strict mode. I just applied the patch you posted, and it appears to have fixed the problem on my localhost environment. The latest version in CVS fixed it a different way, though.
Field 'description' doesn't have a default value query: INSERT INTO drupcjb_aggregator_feed (fid, title, url, refresh, block) VALUES (1, 'Tennessee real-estate economy articles', 'http://news.google.com/news?num=100&hl=en&q=tennessee+real-estate+economy&ie=UTF-8&output=atom', 10800, 5) in C:\localweb\apache2.2\htdocs\jcb\includes\database.mysql.inc on line 172.
Does the 6.x fix get backported to the 5.x series, or should we just backport this patch? It looks very similar to the fix that's used in the CVS.
Comment #13
drupalb CreditAttribution: drupalb commentedThanks a great deal for the patch enobrev.
Comment #14
drummcomputerwill, it would be best to send this to Drupal 6.x or 7.x first.
Comment #15
sammorgan CreditAttribution: sammorgan commentedHow the devil do you apply this patch, from a Drupal genuis/sql novice;)
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedcd
patch < description.patch
Comment #17
sammorgan CreditAttribution: sammorgan commentedThanks ernie. I dont seem to be able to run this command in ms dos or cygwin, command not found! I dont suppose anyone has this patched file?
Thanks in advance
Sam
Comment #18
ztyx CreditAttribution: ztyx commentedPatch command line interface for Windows: http://gnuwin32.sourceforge.net/packages/patch.htm
Comment #19
Anonymous (not verified) CreditAttribution: Anonymous commentedFor cygwin you may need to run the setup program and install it. Ask on their lists for help.
Comment #20
sammorgan CreditAttribution: sammorgan commentedHaving on luck at all with this... Does anybody have the actual patched file? Thanks in advance
Sam
Comment #21
drummI do not think the UPDATE query need to be changed. Drupal 6 does not have
description = ''
. It might remove descriptions which are wanted.Comment #22
dpearcefl CreditAttribution: dpearcefl commentedConsidering the time elapsed between now and the last comment plus the fact that D5 is no longer supported, I am closing this ticket.