Original author dropdown empty for authenticated user role

abraham - March 15, 2009 - 08:38
Project:Planet
Version:HEAD
Component:Code
Category:bug report
Priority:critical
Assigned:abraham
Status:needs review
Description

When "Role to select user from" is set to "authenticated user" the edit form field is empty because role id 2 is not present in users_roles. I think it is assumed to apply to any user with an account.

My recommendation is to get rid of the dropdown and just use an autocomplete form.

I've started working on a patch and will try to finish it in a day or two. (Remind me if it is not done by the end of the week :-/)

#1

sivaji - March 20, 2009 - 11:04

I am curious to see the patch.

#2

abraham - March 22, 2009 - 02:09
Status:active» needs review

This patch changes the original author field into an autocomplete field and removes the role to select users from field. There may be bit I missed removing since the form logic is so intertwined.

AttachmentSize
planet-402414.patch 3.99 KB

#3

abraham - March 22, 2009 - 02:20

Fixed a small typo.

AttachmentSize
planet-402414.patch 3.99 KB

#4

sivaji - March 27, 2009 - 19:27

Hello poseurtech

Great it works !!

But when i edit a feed author name, it does not changes in node table. Here the code to do that

else if ($edit['fid'] && intval($edit['fid']) > 0) {           
        // Username can change, so we need to store the ID, not the username.
        $edit['uid'] = db_result(db_query("SELECT uid from {users} WHERE name = '%s'", $edit['username']));
        db_query('UPDATE {planet_feeds} SET uid = %d, title="%s", link = "%s", image="%s" WHERE fid=%d', $edit['uid'], $edit['title'], $edit['link'], $edit['image'], $edit['fid']);
        // changing the uid of nodes that are associated to this fid.
        $result = db_query("SELECT nid FROM {planet_items} WHERE fid = %d", $edit['fid']);
        while ($nid = db_fetch_object($result)) {         
          db_query('UPDATE {node} SET uid = %d WHERE nid = %d', $edit['uid'], $nid->nid);
        }       
        drupal_set_message('Edited "'. $edit['title'] .'" feed.');     
      }

AttachmentSize
planet-402414.patch 15.21 KB
 
 

Drupal is a registered trademark of Dries Buytaert.