Placeholder for work on porting this module to D7.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webankit’s picture

+1

felipepodesta’s picture

+1
Subs

Tebb’s picture

Will the D7 version of this module integrate http://drupal.org/project/realname into SimpleNews?

pillarsdotnet’s picture

That would be the goal, yes.

Tebb’s picture

Title: Drupal-7 version » SimpleNews RealName: Drupal-7 version

Great.

Changed title to show in dashboard.

shaisamuel’s picture

+1

Quarantine’s picture

Subscribing.

pillarsdotnet’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev

Actually, the D7 format_username() function and associated hook_username_alter() hook makes the RealName module obsolete.

shaisamuel’s picture

Thanks. Can you explain and give direction please, to the most of us, who are waiting? Is there a solution out there we can use?

pillarsdotnet’s picture

Sure. In all code that prints a username, replace $user->name with format_username($user)

And to show (e.g.) a "realname" field supplied by a profile module, write a teensy-weensy module that contains a single function like this:

  /**
   * Implements hook_username_alter().
   */
  function mymodule_username_alter(&$name, $account) {
    $account = user_load($account->uid);
    $name = $account->realname;
  }

For another example, I wrote a tiny module that uses the CiviCRM "display_name" field to format the username.

shaisamuel’s picture

@pillarsdotnet, maybe I dont get it, but in my case the issue is about the simplenews support for subscribers which are not registered uses. Realname adds the username field on the register block as well as in the process of the mail sending. So if there is solution, I would appreciate your guidens.

Thanks, Shai.

pillarsdotnet’s picture

Ah; your use-case is not mine. I register all my subscribers.

waltf’s picture

Subscribing

drupal a11y’s picture

Check "http://drupal.org/node/922662/release" for a first D7 version,

shaisamuel’s picture

Thanks @mori. I think this ver needs a small upgrade, since it contains "db_result" calls, which was removed in D7. I wish I new how to do it. I actually tried, by looking at some other examples, but I have errors. There are total of 6 "db_result", which needs to be changed. If there is someone here who nows how to, please provide the patch, so we can test it.

deggertsen’s picture

Seems to me that this is a much better solution for us to support.

#127178: Make Subscribers fieldable

rofsky’s picture

If you download the 7x version here : http://drupal.org/node/1036302

Replace line 521 on the simplenews_realname.module file with the following:

return db_query('SELECT realname FROM {simplenews_realname} r WHERE r.mail = :mail', array(':mail' => $mail))->fetchField();

That is the proper drupal 7.x way to replace db_result. Drupal 7.x uses a pdo style syntax for db queries. To keep it all on one line as the module is currently written that would work. The ->fetchField(); will return a single value.

Changing that line works for me. So far I have only tested on the block, and frontend.

pminf’s picture

You also have to replace taxonomy_get_term() (Drupal 6 function) with taxonomy_term_load() (Drupal 7 function) in line 249 and 266.

pminf’s picture

After a few minute testing I noticed some issues with mass import. E-mails are not subscribed to newsletter categories and the real name is not displayed after import (notfication area and list of subscribers). Although the real name is displayed in the newsletter. I guess this still needs some work till it can be used in a productive system. Any information about the progress?

hailaz’s picture

subscribing

broon’s picture

In addition to #17 and #18 you should also change line 496
from $account = user_load(array('mail' => $mail));
to $account = user_load_multiple(array(), array('mail' => $mail));
in order to avoid the array_flip error. The most common cause of this error is using a something_load() function with an array as argument. This is not supported anymore because the load_multiple() functions need to be used for this in Drupal 7.

pillarsdotnet’s picture

Status: Active » Needs review
FileSize
2.65 KB

Patch including changes from #17, #18, and #21 above.

sgabe’s picture

I didn't investigate this issue yet on Drupal 7, is this module deprecated/obsolete or still needed for D7?

pillarsdotnet’s picture

@#23 -- see comments #11 and #12.

sgabe’s picture

Category: feature » task
Status: Needs review » Fixed
FileSize
2.28 KB

The attached patch has been committed with the proposed changes. An alpha release should be available soon and the development snapshot is also available from the project page. Feel free to test and give feedback!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.