Comments

Iulian Arcus’s picture

Title: SMS User not ported to 7 » Port SMS User to 7
Status: Active » Needs work
themaurice’s picture

Priority: Normal » Major

Hi, I'm agree, the user module doesn't work at all.

Warning: Parameter 1 to sms_user_load() expected to be a reference, value given in DrupalDefaultEntityController->attachLoad() (line 334 of C:\Program Files\EasyPHP-5.3.3\www\xxxxxxx\includes\entity.inc).

Is there somebody have and idea to patch that ?

By advance thanks.

Cheers,

Gilles

themaurice’s picture

Assigned: Unassigned » themaurice
Category: task » support
Priority: Major » Critical

Hi,
I get also those error :

Warning: Parameter 1 to sms_user_settings_add_form() expected to be a reference, value given in drupal_retrieve_form() (line 773 of C:\Program Files\EasyPHP-5.3.3\www\mysite\includes\form.inc).
Warning: Parameter 1 to sms_user_settings_sleep_form() expected to be a reference, value given in drupal_retrieve_form() (line 773 of C:\Program Files\EasyPHP-5.3.3\www\mysite\includes\form.inc).

and only this text show on mobile page : ArrayArray

Anyway it's seem to be a problem of php reference with the "&" before some variable, I try some modification on sms_user.module without success.

Anybody could provide some help to solve that will be appreciate.

Cheers,

Gilles

Anonymous’s picture

any progress on this issue?

themaurice’s picture

Hi,

I'm not solve this problem and finally not use this functionality.

mcpuddin’s picture

Status: Needs work » Needs review
StatusFileSize
new5.61 KB

I've cleaned up SMS User to be Drupal 7 compatible, at least for my workflow of sending text messages.

mcpuddin’s picture

Just as note, I've closed #795202: Port sms framework project to D7 since the d7 port of smsframework works, but sms_user does not. After reading through its log... there are different versions of the d7 port of sms_user:

If you are looking at solving immediate issues that are only bug fixes with no additional features, I highly recommend doing my patch above, best bang for your time.

mcpuddin’s picture

Assigned: themaurice » Unassigned
NROTC_Webmaster’s picture

I can upload a patch that enables most of the functionality tomorrow. I will try to apply it after your patch so anything you did isn't broken by my patch.

mcpuddin’s picture

NROTC_Webmaster, my patch should have fixed everything for D7. If possible lets focus on the minimalist amount of issues to be fixed so it can be put into dev ASAP. The more code there is the more needs to be reviewed , and the longer we have a broken dev copy out there.

If you can, just review my code and mark it as reviewed. If you feel like it is insufficient, please do send it back with your fixes, but lets leave any additional features out for now.

NROTC_Webmaster’s picture

I only made a couple changes the biggest was updating to db_delete for sms_user_delete. Also the patch is applied to the current version.

mcpuddin’s picture

Thank you so much for applying my patch to yours, makes my life so much easier! I will review today and see if it needs any more adjustments.

mcpuddin’s picture

I reviewed and I really like how you supported deletion the D7 way and got rid of all the @todos

I did remove a piece of your code which was dependent on a hook_token implementation. I'm not very familiar with it, so I just appended the "code" to the end of the string ( which I noticed you cleaned up a bit as well ). However, I removed the token replacement as it is no longer necessary.

Can you take a quick glance at my patch and confirm?

Thanks!
James

mcpuddin’s picture

Specifically the only change in my rework of your patch is:

 function _sms_user_confirm_message($code) {
-  $text_format = variable_get('sms_user_confirmation_message', '[site-name] confirmation code: [confirm-code]');
-  // @todo: d7 token support
-  //$text = token_replace_multiple($text_format, array('sms_user' => array('confirm-code' => $code)));
+  $text_format = variable_get('sms_user_confirmation_message', '[site:name] confirmation code: ') . $code;
+  $text = token_replace($text_format);
   return $text;
 }
NROTC_Webmaster’s picture

Your changes look good to me for a first start. As you said we can work on additional functionality later but I think it is important for this project to get the basics working. I don't know if you use it or not but I have also posted the latest work I have been doing on the sms_email_gateway and the integration for messaging_sms which was removed on the upgrade to D7.

Can this be RTBC or do you want to wait on input from others?

mcpuddin’s picture

I'd say RTBC this one, these patches are long over due.

For your other patches, I'd say create separate issue for each submodule. Thats what I did with the sms blast module: http://drupal.org/node/1449660

NROTC_Webmaster’s picture

Status: Needs review » Reviewed & tested by the community

For sms_email_gateway it is http://drupal.org/node/1289928 and for the messaging_sms it was in there before but they removed it on the upgrade. I added an issue to the queue but do you think it is worth having a separate module just for that?

mcpuddin’s picture

Thanks for reviewing it, all up to univate now!

As for your sms_email_gateway, its marked in D6, i could test it if it was in D7.

As for messaging_sms, was that a separate module or in sms_user? If it was a separate module, just create a new ticket. Lets do this revamp step by step. If it was part of sms_user, create a new ticket called like "restore messaging_sms back to sms_user" and mark it as the SMS User component.

If we put anything else in this one, it'll be way to intimidating for anyone to test and review and they'll get lost. This ticket is for base base base D7 fixes so its no longer DOA.

NROTC_Webmaster’s picture

for the email gateway it is marked as D6 only because it doesn't have the d7 option yet. The uploaded file is for D7.

messaging_sms was a sub folder in the messaging module not sms_user.

mcpuddin’s picture

Ah, in the case I would create 2 new tickets for each.

mfb’s picture

Category: support » task
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new14.21 KB

#13 had a problem with hooks: sms_user_delete() and sms_user_logout() act as hook_user_delete() and hook_user_logout() for sms.module, so these functions need to be renamed.. This patch contains some proposed new names.

Also, I added a hook_tokens() and hook_token_info(). The token support should be worked on further, but I wanted to upload what I have so far since I'm not sure when I'll have time to clean it up..

I modified the SMS registration function to auto-confirm new users. This seems to be required for the welcome message functionality to work - SMS messages cannot be sent to unconfirmed numbers.

christianchristensen’s picture

Update the patch a little to display the proper token replacements in the collapsible dropdown (took inspiration for rendering from the token module replacements tree).

christianchristensen’s picture

Oops - left a dpm in from debugging in previous patch...

christianchristensen’s picture

More debug removal from previous patch and fix registration with SMS callback.

socialnicheguru’s picture

patch does not apply cleanly

aegir@devmac:~/platforms/7/m/all/smsframework$ git apply smsframework-sms_user-upgrade-1247538-D7-24.patch
smsframework-sms_user-upgrade-1247538-D7-24.patch:346: trailing whitespace.
'name' => t('SMS User'),
smsframework-sms_user-upgrade-1247538-D7-24.patch:347: trailing whitespace.
'description' => t('Tokens related to SMS User.'),
smsframework-sms_user-upgrade-1247538-D7-24.patch:351: trailing whitespace.
'name' => t('Confirmation code'),
smsframework-sms_user-upgrade-1247538-D7-24.patch:355: trailing whitespace.
'name' => t('Mobile settings URL'),
smsframework-sms_user-upgrade-1247538-D7-24.patch:359: trailing whitespace.
'name' => t('Temporary password'),
error: patch failed: modules/sms_user/sms_user.info:8
error: modules/sms_user/sms_user.info: patch does not apply

aegir@devmac:~/platforms/7/m/all/smsframework$ patch -p1 < smsframework-sms_user-upgrade-1247538-D7-24.patch
patching file modules/sms_user/sms_user.admin.inc
patching file modules/sms_user/sms_user.info
Hunk #1 FAILED at 8.

NROTC_Webmaster’s picture

Here is an updated version of #24 without the whitespace at the end of a couple of the lines. SocialNicheGuru the patch in 24 applied for me so I don't know why it didn't work for you. Let me know if the new one applies or not.

zeezhao’s picture

Please can someone post a fully-patched version of the whole working smsframework module? Thanks

NROTC_Webmaster’s picture

zeezhao,

Download the 7 dev version and then just apply the sms user patch to it. If you cannot apply a patch then I can post a zipped version for you.

zeezhao’s picture

Was patching also including this fix: http://drupal.org/node/1477744 but did not work, hence the reason to ask for a working version thanks. Please send it anyway.

It would be nice if official dev version gets updated.

mcpuddin’s picture

I don't believe #26 had node/1477744 to it.

I talked with univate and he said that he'd be ok with someone stepping up as the Drupal 7 admin:
http://drupal.org/node/1565598

I haven't tested #26 in awhile, zeezhao can you mark it as "reviewed & tested by the community"

Nigeria’s picture

Could I get a zipped version too. I can test it on a real system immediately.

NROTC_Webmaster’s picture

StatusFileSize
new53.24 KB

For those who are not necessarily concerned with following the repository here is a heavily modified version that should have most of the functions working to some extent. I do not use some of them and others are incomplete but I feel it is a good start. Feel free to post additional changes as you make them.

univate’s picture

StatusFileSize
new115.17 KB

I couldn't get the patch in #26 to apply. But I took the file in #32 and converted into a patch.

univate’s picture

StatusFileSize
new112.15 KB

committed a couple of other simpler bugs, so re-rolling this patch.

Anonymous’s picture

ciao Univate,
I'm tryng to patch against git repo 7.x-1.x but I got following reject:

***************
*** 211,217 ****
// Or render a status code from a simple true/false result
if (! $status) {
if ($options['result']) {
- $status = SWS_GW_OK;
}
else {
$status = SMS_GW_ERR_OTHER;
--- 211,217 ----
// Or render a status code from a simple true/false result
if (! $status) {
if ($options['result']) {
+ $status = SMS_GW_OK;
}
else {
$status = SMS_GW_ERR_OTHER;

After the patching I got also following error:
Call to undefined function sms_carriers() in /smsframework/sms.admin.inc on line 151

Anyway, I succesfully sent sms to mobile phone. Thanks a lot for your great work!

NROTC_Webmaster’s picture

giorez,

Make sure you are always patching against the dev versions and not the stable ones.

Anonymous’s picture

StatusFileSize
new52.05 KB

ciao NROTC,
I'm patching against git repository 7.x-1.x. (refs/heads/7.x-1.x) (origin/7.x-1.x). I can't see any dev version in the 7 branch as shown in the attached image. Sorry I'm not good in git usage.
I also tried to patch against http://ftp.drupal.org/files/projects/smsframework-7.x-1.x-dev.tar.gz, but the patch is failing because some extra text like "; Information added by drupal.org packaging script on 2012-05-10" into the .info files.
Any suggestion?
thanks in advance

cashwilliams’s picture

Status: Needs review » Needs work

patch in #34 doesn't apply, probably just needs to be rerolled.

smsframework-1247538-34.patch:1446: trailing whitespace.

smsframework-1247538-34.patch:120: new blank line at EOF.
+
smsframework-1247538-34.patch:790: new blank line at EOF.
+
smsframework-1247538-34.patch:843: new blank line at EOF.
+
smsframework-1247538-34.patch:1017: new blank line at EOF.
+
error: patch failed: modules/sms_track/sms_track.module:211
error: modules/sms_track/sms_track.module: patch does not apply
mcpuddin’s picture

StatusFileSize
new111.81 KB

I also had the same problems when I tried to apply the patches to the downloadable versions. However, when I checked it out from GIT it worked .. better:

  1. Go to http://drupal.org/node/165911/git-instructions/7.x-1.x
  2. Checkout the git repo git clone --recursive --branch 7.x-1.x http://git.drupal.org/project/smsframework.git

I'm not very experienced on Drupal's automation process of creating the zips and .tar.gzs, but it seems like it injected a bunch of stuff which makes the patches incompatible. Take a look at this pastebin http://pastebin.com/jqG6VUgQ

I also cleaned up #34 a little bit by removing a fix to sms_track module which seemed to be already taken care of, and repackaged it.

I'm not sure why these patches don't work on the snapshot, however I'm trying to figure it out.

James

mcpuddin’s picture

I talked with some folks on IRC and they said just to use the git checkout instead of the snapshot.

mcpuddin’s picture

StatusFileSize
new111.22 KB

I was testing the patch and noticed there were a couple of problems

  1. Some dsm debugging code was left in it, so I removed it
  2. Cleaned and fixed up the confirmation message

Other than that, the sms_user portion seems to works well. I have time this coming week to crunch this out if anyone else wouldn't mind jumping in and testing this piece.

James

mcpuddin’s picture

Status: Needs work » Needs review
socialnicheguru’s picture

#39 links don't seem to work. did you mean
http://drupalcode.org/project/smsframework.git/

mcpuddin’s picture

Hey Social Niche Guru, you have to run those via the command line with git. Take a look at http://drupal.org/node/707484

mcpuddin’s picture

Status: Needs review » Fixed

Alright, this was just committed! Thanks guys for your hard work! If any more issues are discovered with it, please open up separate issues.

Status: Fixed » Closed (fixed)

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

  • Commit a4a4e69 on 7.x-1.x, 8.x-1.x:
    Issue #1247538 by mcpuddin, NROTC_Webmaster, mfb, christianchristensen:...