Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Isn't the machine-readable "type" field supposed to be locked? If the type is changed to "profile" or anything else, the text in the Bio tab disappears from the user profile and navigating to user/uid/bio or user/uid/profile just shows the regular user profile.
Comment | File | Size | Author |
---|---|---|---|
#11 | bio-lock-type-name-203331-11.patch | 1.24 KB | webchick |
Comments
Comment #1
jjeff CreditAttribution: jjeff commentedYes, a great patch would add a hook_form_alter() to make the machine-readable name of the the currently selected bio node-type uneditable. The alter should also add or change the description of this field to explain why it is uneditable and link to the bio settings page where the admin can select a new node type as bio.
Comment #2
Christefano-oldaccount CreditAttribution: Christefano-oldaccount commentedI'm interested to know if altering the node type form is a better idea but it may be better to just change
'locked' => FALSE
in bio.module to'locked' => TRUE
and then roll out an update in the bio.install file.This won't work in if the bio node type has been changed to something else, but I immediately got errors when trying that and imagine that anyone else would, too:
Comment #3
Christefano-oldaccount CreditAttribution: Christefano-oldaccount commentedI forgot to mention that this bug only appears when Views is installed.
Comment #4
Christefano-oldaccount CreditAttribution: Christefano-oldaccount commentedOK, bumping this up to get more eyes on it. Code is included above but a patch isn't attached because I'd prefer not to roll one just to change one line in the bio.module file.
Has anyone else had this problem or is it just me?
Comment #5
webchickIt's desired that the type is in fact /not/ locked. So I think something along the lines of jjeff's fix in #1 makes more sense.
Comment #6
webchickComment #7
Christefano-oldaccount CreditAttribution: Christefano-oldaccount commentedWhy is this desired behavior? I'm actually curious because I've had nothing but problems when I try renaming the machine-readable name. The error in bio_views.inc reported in #2 does appear to have been fixed, though. Thanks for all of your recent work, webchick!
This is the error received this morning with the latest Bio 5.x-1.2 when changing the name from bio to something else and then visiting the User biographies settings page:
Comment #8
webchickThe lack of "locked" flag is what's desired behaviour. We want people to be able to blow away that content type altogether if they don't want it. If it's set to "locked" then the only way to get rid of it is to disable Bio module, even if you're using some other content type like "Super Profile" as the Bio content type.
The error, obviously, is not desired. ;) So we should use hook_for_alter to either disable the ability to edit the type name altogether (jjeff's suggestion) or else add another submit handler and do a variable_set() to change the bio_nodetype setting when the type name changes.
Comment #9
webchickAlso, bumping this to critical as a note to fix it before 1.3.
Comment #10
webchickHuh. Interesting. Changing locked to TRUE does /not/ appear to block me from deleting the node type, despite what it's supposed to do. ;)
Ok cool. Let me whip up a patch.
Comment #11
webchickHere's the patch that does what you suggest.
I'm not sure though. It seems like if someone's already gone through and changed "Biography"/"bio" to "Profile"/"profile" manually that it's going to change it back on them suddenly, and then their themes, etc. will break. A hook_form_alter solution might be best after all.
Note that this is only a suspicion. I don't have time to actually test the patch atm.
Comment #12
gausarts CreditAttribution: gausarts commentedGot the same exact problem with 5.x-1.2 when I change machine-readable bio to profile. The worst thing is when a user edited his own bio, the profile page disappeared from his eyes upon submitting, but strangely still visible to admin role. A successfull message on updating displayed, no error logs, but the profile just disappeared. Any help would be appreciated. Thanks
Comment #13
webchickDid the patch work?
Comment #14
gausarts CreditAttribution: gausarts commentedHave no idea how apply a patch. Perhaps I'd better wait for the stable release and try to stick with the bio unchanged. It's just useless to change it to other word anyway since the link always refers to the word bio. Thanks for the great module.