Posted by yas on September 11, 2007 at 1:01pm
| Project: | Content Injector (formerly AdSense Injector) |
| Version: | 6.x-2.6-rc2 |
| Component: | Code |
| Category: | task |
| Priority: | critical |
| Assigned: | hswong3i |
| Status: | closed (fixed) |
Issue Summary
I faced an error when using adsense injector with Case Tracker module.
When I try to save the settings for adsense injector, the following error occurs:
Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '<em>Duplicate entry &#039;adsense_injector_nodetype_casetracker_basic_proj&#039; for key 1\nquery: INSERT INTO variable (name, value) VALUES (&#039;adsense_injector_nodetype_casetracker_basic_project&#039;, &#039;i:0;&#039;)</em>: <em>/home/xlayer/public_html/includes/database.mysql.inc</em> の <em>172</em> line', 2, '', 'http://xlayer.jp/admin/settings/adsense_injector', 'http://xlayer.jp/admin/settings/adsense_injector', '67.174.205.243', 1189514927) in /home/xlayer/public_html/includes/database.mysql.inc on line 172The varchar length of 'name' column in 'variable' table is 48. When we use with Case Tracker module, adsense injector makes a variable name like:
adsense_injector_nodetype_casetracker_basic_project
This variable name is too long. The database allows to save adsense_injector_nodetype_casetracker_basic_proj because of the limitation of the 'name' column length, and it causes an error.
Comments
#1
Raising priority. Investigating solutions.
#2
I created a patch that ensures that the error message is stored correctly in the watchdog table:
#298768: Ensure that entries are written to watchdog table
Unfortunately this doesn't solve your real problem.
#3
Workaround: alter the variable table to allow longer variable names.
Example: See issue #133106: Value for name field in variable table is too long
<?phpfunction captcha_install() {
db_query("ALTER TABLE {variable} CHANGE name name varchar(255) NOT NULL default ''");
}
?>
#4
#5
I need to fix this in 5.x and 6.x
#6
Simply fork taxonomy_form_vocabulary() handling can totally solve this problem. According to this patch handling, all node type setup will save into single variable in array format, e.g. with only blog activated:
<?phpArray
(
[blog] => blog
[book] => 0
[image] => 0
[page] => 0
[story] => 0
)
?>
This patch also remove the fancy notice if no node type selected: user should understand this style as they understand what taxonomy_form_vocabulary() did. This shouldn't become usability problem :D
#7
@hswong3i :
Looks good, go for it.
Users will have to re-establish settings, though.
#8
@inactivist: Yes, you are right. This is the only trade-off i guess :S
So I will commit it to D6 CVS and also backport for D5. After this we should have another RC release :D
#9
As there is no negative feedback for this issue, I will mark it as fixed :D
#10
Automatically closed -- issue fixed for two weeks with no activity.