The "link to user" option in the Mail Field does not shown all options. You could only decide between a link to the user and render as mailto link. But the option "no link" is hidden. The reason is because in the option_form function of the field handler, the parent method is called after we add the option "link_to_user". If we change this, we see the option and then it works.
In file ./views/modules/user/views_handler_field_user_mail.inc has to be changed from:
<?php
function options_form(&$form, &$form_state) {
$form['link_to_user'] = array(
'#title' => t('Link this field'),
'#type' => 'radios',
'#options' => array(
0 => t('No link'),
'user' => t('To the user'),
'mailto' => t("With a mailto:"),
),
'#default_value' => $this->options['link_to_user'],
);
parent::options_form($form, $form_state);
}
?>
to
<?php
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['link_to_user'] = array(
'#title' => t('Link this field'),
'#type' => 'radios',
'#options' => array(
0 => t('No link'),
'user' => t('To the user'),
'mailto' => t("With a mailto:"),
),
'#default_value' => $this->options['link_to_user'],
);
}
?>
Comments
Comment #1
dawehnerCan you please provide a real path? It's much easier to understand what's going on
Comment #2
hunziker commentedSure, here is it:
I hope this clarify what I mean.
Comment #3
hunziker commentedComment #4
hunziker commentedAny update on this?
Comment #5
dawehnerEverytime you do an status update a kitten is killed.
Comment #6
merlinofchaos commentedSorry, dereine typo'd his request. dereine meant to ask for a real patch. See the drupal.org resources for creating patches.
We need patch files in order to evaluate changes. It is very difficult to scan two pieces of code, side by side, and see exactly what is different.
Comment #7
hunziker commentedWith the risk of killing some other kitten, I will add my "path" (aka patch).
Comment #8
dawehnerPatch looks fine, thanks!
In general it's helpful if you set the status of an issue to "needs review" once it has a patch.
Commited the patch to 7.x-3.x
Comment #9
hunziker commentedI will do so this in future. Thanks for committing.
Comment #11
hunziker commentedThe commit get lost in the latest dev version of views. Please recommit it.
Comment #12
hunziker commentedSorry I'm wrong. I mix it up with a old version.