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.
Just noticed that all the sites I'm creating are authorless. I'm not sure if this code is new or not, but I think it's caused by this snippet in hosting.module:
// Remove additional UI added by core modules, that conflict with the hosting UI.
$node_types = array('site', 'platform', 'server', 'client');
foreach ($node_types as $type) {
if ($form_id == $type . '_node_form') {
unset($form['options']);
unset($form['menu']);
unset($form['revision_information']);
unset($form['author']);
unset($form['comment_settings']);
// because these aren't really posts, 'preview' doesnt make sense in this context.
unset($form['buttons']['preview']);
}
}
I think when the author field is unset, drupal won't use the defaults. I've only tested this on site nodes, but I assume the same will happen on all. The attached patch fixes this by setting the uid for the node in the presave nodeapi hook. Not sure if this is the best, or right way to go about this.
Comment | File | Size | Author |
---|---|---|---|
hosting_node_author.patch | 784 bytes | hadsie |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedI don't know if it's a big deal, but I suppose now that I have committed #767008: New users aren't associated properly with their respective client nodes on site signup, we should probably be consistent with the rest. And this patch works.
This was also patched against what looks like CVS, from inside the 'hosting' level directory - which is ancient code. Please patch against the hostmaster repo in git.aegirproject.org in future if you can - thanks! (granted we don't make it too obvious :) )