When I enable anonymous posting on any content type (admin/user/anonymous-posting page,) I receive the following error:

user warning: Data too long for column 'type' at row 1 query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (1, 'Anonymous Posting module', 'Added %fname field to content type %ntype', 'a:2:{s:6:\"%fname\";s:22:\"field_anonymous_author\";s:6:\"%ntype\";s:5:\"forum\";}', 5, '', 'http://localhost/admin/user/anonymous-posting', 'http://localhost/admin/user/anonymous-posting', '127.0.0.1', 1306787775) in F:\Apache Software Foundation\Apache2.2\htdocs\modules\dblog\dblog.module on line 146.

The anonymous fields do not show up on the form, and if I look at the cotent type display fields, the anonymous contact info is all set to Hidden with no options to display.

I'm on D6.22 with all other contribs up to date.

Thanks,

-=Delty

Comments

drikc’s picture

Hello,

So it is that watchdog() that pushed this warning. Perhaps it went through the installation without rebuilding the cache so please try to 'clear cached data' in admin/settings/performance and let me know if the fields show up now.

If that didn't do could you try to change the line 65-66 in anonymous_posting.inc with the following:

watchdog('anonymous_posting', 'Added %fname field to content type %ntype',
          array('%fname' => ANONYMOUS_POSTING_FIELD_NAME, '%ntype' => $key));

(It just change the string 'Anonymous Posting module' with 'anonymous_posting') and then reinstall the module (disable, uninstall then reinstall).

I'm asking to do this because I couldn't reproduce that issue here even with Drupal 6.22.

Thanks.

delty’s picture

Thanks for taking a look, Drick. The first thing I did before submitting was clear out all the caches. I then tried disabling, uninstalling, then re-installing with the same error. Finally, I just made the change you posted above, but the issue still persists.

I'll have to take a look at conflicting modules now. I'll let you know if I find anything new.

Thanks,

-=Delty

delty’s picture

Ok, changed the watchdog type string to 'anon_post' and it now enables just fine. I looked through the watchdog table and there were no type entires longer than 15 chars.

Still, though, the fields do not appear on the form (content type=Forum topic). I've update the permissions after enabling the form, and I can see the "Anonymous contact information" in the display fields list, but it's set to 'hidden' on both the teaser and full node.

Thanks,

-=Delty

drikc’s picture

Ok, be sure to do a module "disabling, uninstalling, then re-installing" after your change of string to 'anon_post'.
The input fields should appear in the node form.

The display fields list show the "Anonymous contact information" field as hidden and that is normal, the author name is shown as a substitute of the 'Anonymous' string and is done in some coding in the module.

I've fix the watchdog() call so that $type argument feet in the 16 char length defined by the dblog module. Will be reflected in the beta2 and the dev to be released shortly.

delty’s picture

I've downloaded the new version, disabled, uninstalled, copied and reinstalled with the dev version from today. While the installation acts normaly and I can enable the Forum Post content type for use with Anonymous Posting, with the default install, the fields still did not show up on the form.

I do, however, have it functioning. I cleared out the cache, rebuilt the permissions, and finally changed the module weight to 20 (up from 0) which made everything start working! Changing the weight inside the module might help it install more reliably on other people's systems, so it might be something you'll want to do.

In any case, it works great now and was just what I needed - thank you!

-=Delty

drikc’s picture

Status: Active » Fixed

Hello, thank you for the report.

If it's the module weight that fixed the hidden fields issue then probably one of your installed module was overriding the Anonymous Posting work. But that is a supposition, for now I will turn this issue status to fixed as it seems it's independent of the hidden fields issue you had.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.