naming the database table {content_field_privacy} was a bad idea because this is also the format for cck fields, so technically anyone who creates a CCK field called "Privacy" (or field_privacy) would run into problems when the table that CCK tries to create already exists. therefore, i changed the table name to just {cckfp} which matches the variable naming scheme we've been using.

also, when a user doesn't have permission to the AJAX MENU_CALLBACK, they should get a blank page not the 404 page. So, now the user_access() checking happens inside the MENU_CALLBACK function instead of the hook_menu() function. also, the function should exit not return a boolean TRUE or FALSE, because then it is wrapped in the site template.

(see attached patch)

CommentFileSizeAuthor
cck_field_privacy.patch4.39 KBms2011

Comments

obsidiandesign’s picture

Code looks good - the question I have is how to best & properly handle the switch for users that are currently using the module. Insert & delete the old table? Insert & keep, then have an option to delete? Don't allow a direct copy?

ms2011’s picture

There should be a way to rename a table using ALTER TABLE syntax. I would do it as a hook_update_N() in the .install file.

obsidiandesign’s picture

Patch committed - thank you mike for the patch. I added in the hook_update_N() syntax to update 5.x-1.0 versions of the DB table.

obsidiandesign’s picture

Status: Needs review » Fixed

Patch committed - thank you mike for the patch. I added in the hook_update_N() syntax to update 5.x-1.0 versions of the DB table.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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