I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Bug #1944

Empty facebook value does not have a match

Added by Daniel Seifert almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Major
Assignee:
Category:
-
Target version:
Start date:
15 Jan 2012
Due date:
17 Jan 2012
% Done:

100%

Redmine version:
1.3.0
External issue:

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

Hmm, or after more testing:
  1. I go to my profile, enter some values (but neither linkedin, blog and twitter), save it
  2. in overview page, I have a blog, linkedin and twitter icon
  3. remove values from database table (values are set to empty string)
  4. go to my profile again, just hit save
  5. 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!

Also available in: Atom PDF

Terms of use | Privacy policy