I'm working on importing from another CMS and I have 'node' titles separate from page titles. Page_title handles this, it just needs to be exposed to Migrate module.

Tim Knittel

Comments

BrandTim’s picture

StatusFileSize
new1.81 KB

Patch attached. Note that this patch does not honor Page_title's permissions; someone with the permission to Migrate will be able to put data into the newly created nodes' page titles regardless of whether or not they have permission from Page_title.

Tim Knittel

BrandTim’s picture

Status: Active » Needs work

Forgot to change the status to 'needs work.'

Tim Knittel

cedarm’s picture

Status: Needs work » Needs review
StatusFileSize
new5.15 KB
new4.88 KB

@BrandTim - actually permissions are respected due to checks surrounding the database queries, but this breaks drush migrate integration.

Seems to me it's wrong to check user_access() in hook_nodeapi(), hook_user(), and hook_taxonomy(). I think the proper place is in the forms, either by not altering or adding #access properties. Attached is a patch against 6.x-2.3 for those who need a solution now, and a patch against 6.x-2.x-dev for review. Quite a bit has changed in -dev, so I'm not sure if all of the access checks are correct. Please review.

nicholasthompson’s picture

Thanks cedarm. As you've pointed out, a LOT has changed in dev. I really want to get a tagged release out, so I'm not gonna push to get this into 2.4, but it will DEFINITELY go into 2.5.

Thanks for that patch - I'm interested in that suggestion of putting it in #access rather than in the api hooks. Would that not impact anything which programatically saves data?

cedarm’s picture

No problem. I understand about wanting to tag a release.. been there.

As I understand it, if #access is FALSE it's as if that form element isn't even there. As long as validate/submit handlers can deal with that, everything works. As for programmatically saving data, modules like migrate just set node properties and expect the normal save handlers to do their job. Are you concerned that other modules won't honor/check page title permissions themselves in this case?

Programmatically submitting a form may be different.. I'm no expert here. But note that by using #access other modules can form_alter and change it. That's a good thing, right?

damienmckenna’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

The D6 branch is no longer supported so no new features will be added.