Bug #9

[PATCH] Article.user_id fix + User Post Count addition to User Admin Page.

Added by Redmine Admin 1229 days ago. Updated 674 days ago.

Status :Closed Start :
Priority :High Due date :
Assigned to :tobi - % Done :

0%

Category :sidebars
Target version :4.0.4
Resolution :

fixed


Description

This patch fixes a bug in app/controllers/content_controller.rb where the user_id field of Articles is not set when a new article is created. I simply did a lookup of the 'id' using the following statement:

@article.user_id = ( User.find(:first, :conditions => login = ) ).id;

I first noticed this wasn't happening when the feature I also included didn't work correctly. It adds a "Number of Articles" comment to each User in the Admin/User page. Which requires the user_id be set in the articles table.

The following was added to /app/views/admin/users/_user.rhtml

<p>Number of Articles: <%= Article.count "user_id = #{user.id}"  %></p>

History

07/25/2005 06:49 AM - scoop -

  • Status changed from New to Closed
  • Resolution set to fixed

(In r431) Populate user association in new articles posted via Content Admin. Display number of articles per user in User Admin. (closes #203) []

Also available in: Atom PDF