Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.5
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Issue tags:
Reporter:
Created:
23 Mar 2010 at 03:38 UTC
Updated:
1 May 2016 at 13:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerIf you remove the uid, only the image get displayed: http://api.drupal.org/api/function/template_preprocess_user_picture
Thats out of scope of views, but you could make a patch to make it configurable.
Comment #2
fizk commentedNice! I think it's within the scope of views to have this as a configurable option.
Comment #4
fizk commentedSo the option would be something like,
Use default theming for user's photo:
or even simplier
Link to user's profile:
Comment #5
dawehnerI would do the second one... Additional i'm again theme('user_picture_plain', ...)
Comment #6
fizk commentedGreat, I can create a patch if you agree it's within view's scope?
Comment #7
fizk commentedLooking at imagecache_profiles:
Means that we need to have $values->{$this->aliases['uid']} return NULL for subclasses of views_handler_field_user_picture when our new option is set.
Or modify $values.
Comment #8
fizk commentedYaay, this works:
All we have to do is change the "if (true)" to an option.
Comment #9
fizk commentedand the patch! :)
Comment #10
fizk commentedComment #11
fizk commentedoops, default value wasn't correct.
Comment #12
fizk commentedTesting with three user photo fields shows that
foreach($values as $value) {isn't right....how to get the option <==> values pair for each field in pre_render()?
Comment #13
fizk commentedWe could make the change in render(), and bug the imagecache_profile maintainers to update their code.
Comment #14
dawehnerIts a boolean so make a boolean as default.
Choose boolean values here.
Use boolean here... I'm not sure about NULL, does it the same as unset?
Comment #15
fizk commentedunset works too. Here's an updated patch using boolean.
Comment #16
dawehnerA inline comment would be cool, why unsetting the uid here removes the link
Comment #17
fizk commenteddone.
Comment #18
finex commentedsubscribing
Comment #19
fizk commentedCan someone please test and commit this ASAP?
Comment #20
finex commentedI've just tried the patch but it doesn't work. The form is added on the configuration, but the link is not removed.
Comment #21
dawehnerSo needs work
Comment #22
walden commentedsubscribing
Comment #23
fizk commentedFiNeX, do you have imagecache_profiles module installed? If you do, please disable it and test again.
Comment #24
fizk commenteddereine, does it work for you?
Comment #25
fizk commentedwalden, does it work for you?
Comment #26
finex commented@fizk: Yes, I have imagecache_profiles installed. Without it the patch is ok...
Comment #27
fizk commentedFinex, thanks!
dereine, can you commit?
Comment #28
dawehnerNo i cannot commit.
Comment #29
dawehnermore minor: we should use array('default' => 1) because its done this way everywhere in drupal.
some minor spaces
So we set $account->uid with a NULL? Is it isset or "" afterwards?
I might think that this could/will lead to errors when a user try to load the account of a picture which will be done.
Powered by Dreditor.
Comment #30
dawehnerAdditional you cannot RTBC your own patch, thats my oppinion :)
Comment #31
fizk commentedI think isset($account->uid) would return FALSE.
I'm not sure what you mean. The $account variable is only used for
theme('user_picture', $account);Comment #32
fizk commentedYou should get the infrastructure team to remove the issue creator's ability to RTBC ;)
Comment #33
idflood commentedsubscribing
Comment #34
verta commentedsubscribing
Comment #35
capaneus commentedsubscribing
Comment #36
dawehnerI think needs work is the right status.
Comment #37
michellezeedru commentedSubscribing
Comment #38
verta commentedWilling to test a patch, if one is available, we could use this feature.
Comment #39
dawehnerSee #17 for the patch. If the patch works this is fine. But there are still code issues which was reported above.
Comment #40
fizk commenteddereine, what are the code issues?
Comment #41
verta commentedI can confirm that the patch in #17 does add the UI to make linking to the profile optional, and it works to remove the hyperlink.
One downside is that if you do not link to the profile the ALT tag does not using the Real Name (if you hover over the photo you get "userid's photo" - if you do link to the photo, you get the Real Name. (Perhaps because that sends it through the theming functions.) It would be a better patch without this side effect on the ALT in the IMG tag, just my opinion, realizing that it's more complex to try to separate them.
Because we need ImageCache, with or without the helper module referenced, we have added a photo field to the profile, populated it with the table wizard and we're using that field in our view.
Comment #42
dawehnerIs there a reason why the realname module does not override the handler?
Comment #43
Apfel007 commentedsubscribe
Comment #44
esmerel commentedI'm going to give this one more month to get finished, otherwise, I'm going to close it.
Comment #45
verta commentedThis issue may possibly be a duplicate, #720772: "User: picture" link cannot be changed, where there is some code posted?
Comment #46
fizk commentedesmerel,
All the issues for the patch have been fixed. As far as I know, it's been tested by a few people other than me and works. You can commit this to CVS if you have commit rights.
Comment #47
bcobin commentedApplied the patch in #17 and whereas it adds a select option not to link to the user's profile, the setting has no effect - pictures are still linked to the profile and link override likewise has no effect. Disabling Imagecache Profile Pictures doesn't fix the forced link either.
Comment #48
merlinofchaos commentedfizk: dereine posted a very clear review in #29. Nothing in #29 has been addressed. Therefore, 'needs work'.
Comment #49
esmerel commented@46: dereine and merlinofchaos have the final say on code commits, so no, I'm not committhing anything even though I have the ability to do so. If dereine's question in @42 was answered adequately by 47, then I think he can change this to rtbc. However, I am not sure his question was answered.
Comment #50
fizk commentedSorry, I don't have time to work on this patch.
Please reopen only if you can fix and commit as requested by merlinofcaos and dereine.
Comment #51
Michsk commentedfizk: what kind of funding would you need to fix the small issues ment before in the patch?
Comment #52
Michsk commentedWe should also make this work with the default avatar, if a user has not yet chosen / uploaded a own avatar.
Comment #53
fizk commentedThe patch works for me on a fresh install of Drupal 6.22 and Views 6.x-2.12.
Fixed.
Fixed.
!isset($account->uid) returns TRUE
empty($account->uid) returns TRUE
$account->uid === null returns TRUE
$account->uid == '' returns TRUE
$account->uid !== '' returns TRUE
Only if using $account->uid before checking if it has a value. For example, in template_preprocess_user_picture, a check is made to see if it's empty:
if (!empty($account->uid) ...Comment #54
Michsk commentedYour awesome man! Thanks for this.
// will do the testing later on today.
Comment #55
hydra commentedThe patch first looked fine, but unsetting $values->{$this->aliases['uid']} could might make trouble to other fields, wich will use this variable, for example the title field. Disabeling the link on the userpicture would cause, that the title link to the user would be broken.
This should prevent this.
Comment #56
hydra commentedstatus update
Comment #57
fizk commentedThanks Hydra, that makes sense.
Should be removed.
Comment #58
hydra commentedHell yeah :) okay here it is
Please review, d7 Patch is already waiting
Comment #59
fizk commentedIasac, does #58 work for you?
Comment #60
Michsk commentedGoing to test it tomorrow.
Comment #61
dawehnerThis patch seems to look fine, but in general i'm wondering whether this still be applied to 6.x-2.x, as from my perspective this doesn't seem to be a bug of views, but a feature request.
Comment #62
hydra commentedindeet! This is defenetly a feature request, overread this.
Comment #63
dawehnerAnd it's only against 6.x-3.x and later. There are no new feature requests for 6.x-2.x
Comment #64
Michsk commentedwell it doesn't seem to work, but that offcoures might have to do with imagecache profiles
Comment #65
Michsk commentedYap, this option does not work with imagecache profile
Comment #66
Michsk commentedThe patch is tested and works. I will post a link to this threat in imagecache profile
Comment #67
hydra commentedThe patch is working for 6.2, but how dereine sayed, it has to work with 6.3 to be commited, I will post a new patch later, if I have time. For all people who need this in 6.2, the patch will do it
Comment #68
hydra commentedOkay here now the 6.x-3 patch. I replaced the radiobuttons with a checkbox, because every other option is handled with checkboxen too. Additionally I added a little description to the field in the ui.
Comment #69
Michsk commentedCheckboxes sound unlogic, since you can only make one choice.
Comment #70
hydra commentedWell, probably you havent noticed, but every "single choice" in views is a checkbox. It would be inconsistent to use radiobuttons now and would not make sense.
Comment #71
hydra commentedOkay a few little changes here. After switching from radio-buttons to checkbox the options are pretty much useless. I changed the comment above, becuase the uid is not longer unsetted, its just not set.
Comment #72
dawehnerSo commited to 6.x-3.x
Thanks for the work!
This should probably be ported to d7
Comment #73
hydra commentedHere is the patch for D7, its probably the same, I'm not quite sure if this is right, but it works all fine in UI
Comment #74
hydra commentedokay, here a better version
Comment #75
hydra commentedLool, missing header...
Comment #76
dawehnerThanks again! Commited to 7.x-3.x as well.
Comment #78
Toktik commentedUsing 7.x-3.1 and having this problem. I am still unable to Rewrite user picture link.
Comment #79
dawehnerI'm sorry but this is not scope of the issue.
As views is not generating the link it can also not control the link.
Comment #80
pipep commentedI had to deal with the same issue. I'm on D7. 12 and views 3.1.
I have a view for showing comments, with relationship with comment:author and comment:content.
The fields I wanted to show were user:picture, user:name, comment: post date, comment:comment, content:delete link, content: title, comment: view link.
User:picture has the link to user's profile disabled but still generates the link.
I solved this making a wrapper div for the hole view, and with jquery converting it to a clickable div with higher z-index than the pic, so even if u click on the pic it takes u to the comment and not to the user.
Comment #81
Marc Ledergerber commentedSummary: Utilize Drupal Views and the built-in customization settings to "REWRITE RESULTS" and selectively "Strip HTML tags". Doing this effectively removes the
<a>tag (which includes the href attribute) on "User: Picture" images that would otherwise print and thereby create links to users' profiles.How to remove the
<a>tag from users' images on your View to prevent a link to users' profiles.[The attached screen shots illustrate these quick, easy configuration steps for Views 7.x-3.5.]
Step #1: Go to yourdomain dot whatever/admin/structure/views/view/nameofyourview/edit
Step #2: Edit View for User Picture Field
<a href="URL">)<div> <img>(add just the particular HTML tags required for your customized configuration)Step #3: Reload your view (page/block). User images display fine with no links to profile page.
Comment #84
jvieille commentedNever committed to D6 apparently (Views 2)
Made a mix between #57 and #75
Comment #85
Marc Ledergerber commentedFor Drupal 7.43+ with Views 7.x-3.13+, solution described in #81 is confirmed. Views has been included in Drupal 8 core, so this is even easier to implement in Drupal 8.
For an example implementation, see https://ediscoverypeople.com