Bug #1944
Empty facebook value does not have a match
100%
Description
Running newly updated plugin (incl. extended_fields) after having used the old version before. Going to a project where a user without a facebook entry is shown I get the error below
A ActionView::TemplateError occurred in projects#show: undefined method `match' for nil:NilClass On line #28 of vendor/plugins/extended_profile/app/views/extended_profile/_author.rhtml 25: <%= link_to(image_tag('blog.png', :plugin => 'extended_profile'), link) %> 26: <% end %> 27: <% if facebook %> 28: <% link = facebook.value.match(%r{^[0-9]+$}) ? "http:/www.facebook.com/profile.php?id=#{facebook.value}" : "http:/www.facebook.com/#{facebook.value}" %> 29: <%= link_to(image_tag('facebook.png', :plugin => 'extended_profile'), link) %> 30: <% end %> 31: <% if twitter %>
Changing line 28 to link = (facebook.value =~ %r{^[0-9]+$}) ? ...
fixed the issue.
History
#1 Updated by Daniel Seifert almost 13 years ago
That said, with some of the old users there seem to be other issues. I have one user with an empty LinkedIn and empty Blog entry and he gets icons for those pointing to http://
. The corresponding database entry is NULL.
#2 Updated by Daniel Seifert almost 13 years ago
- I go to my profile, enter some values (but neither linkedin, blog and twitter), save it
- in overview page, I have a blog, linkedin and twitter icon
- remove values from database table (values are set to empty string)
- go to my profile again, just hit save
- again, I have a blog, linkedin and twitter icon visible!
#3 Updated by Andriy Lesyuk almost 13 years ago
- Status changed from New to In Progress
- Priority changed from Normal to Major
- Target version set to 1.1.0
Thanks for reporting!
#4 Updated by Andriy Lesyuk almost 13 years ago
- Project changed from Extended Profile to Extended Fields
- Target version deleted (
1.1.0)
#5 Updated by Andriy Lesyuk almost 13 years ago
- Status changed from In Progress to Under Verification
- Target version set to 0.1.0
- % Done changed from 0 to 90
This bug is in the code for Author Box in Extended Profile... But it’s caused by incorrect interpretation of a value returned by custom_value_for_user
function of Extended Fields. So I decided to move this issue here!..
I could fix it in Extended Profile but this would need much more code (and could cause other errors later). Besides new Extended Fields is going to be released soon as it will contain some other fixes...
Please update Extended Fields from SVN and check!
#6 Updated by Daniel Seifert almost 13 years ago
Updated both and problem is gone. Thanks for the quick fix.
#7 Updated by Andriy Lesyuk almost 13 years ago
- Due date set to 17 Jan 2012
- Status changed from Under Verification to Closed
- % Done changed from 90 to 100
You are welcome!