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.
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'],
);
}
?>
Comment | File | Size | Author |
---|---|---|---|
#7 | user-link-to-1216288-0.patch | 804 bytes | hunziker |
#2 | Screenshot 1.png | 11.05 KB | hunziker |
#2 | Screenshot 2.png | 11.35 KB | hunziker |
Comments
Comment #1
dawehnerCan you please provide a real path? It's much easier to understand what's going on
Comment #2
hunziker CreditAttribution: hunziker commentedSure, here is it:
I hope this clarify what I mean.
Comment #3
hunziker CreditAttribution: hunziker commentedComment #4
hunziker CreditAttribution: hunziker commentedAny update on this?
Comment #5
dawehnerEverytime you do an status update a kitten is killed.
Comment #6
merlinofchaos CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: hunziker commentedI will do so this in future. Thanks for committing.
Comment #11
hunziker CreditAttribution: hunziker commentedThe commit get lost in the latest dev version of views. Please recommit it.
Comment #12
hunziker CreditAttribution: hunziker commentedSorry I'm wrong. I mix it up with a old version.