News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[SMF 2b3] Problem removing 'Finished' Subscription.

Started by siath70, March 30, 2008, 04:17:34 PM

Previous topic - Next topic

siath70

You can't remove a finished subscription member. This was also in the 1.1.4 version.

Clean install and tested it to see if it was fixed.

You can however, delete an active subscription member. This is how I was removing them in 1.1.4, I'm not a code guru so I couldn't figure out what it would let you remove the actives but not the finished.

rsw686

Just noticed this as well. The only way to remove it is to change it back to active, then delete it.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

siath70

As a side note, I have noticed that this bug effects the scheduled maintenance too. It will not remove finished sunscriptions either.

siath70

OK I found the problem with the remove feature:
It allows removal of ACTIVE and FINISHED subscriptions, I wanted this anyway.


One thing of note:
This did not fixed the maintainence routine, I haven't looked at it yet. But I'm going to assume it's the same problem.

The problem was it was getting only the ACTIVE subscriptions, it overlooked the finished.

Here is the fix:

ManagePaid.php file search for this.

// Get all of the subscriptions for this user - it will be necessary!
$request = $smcFunc['db_query']('', '
SELECT id_subscribe, old_id_group
FROM {db_prefix}log_subscribed
WHERE id_member = {int:current_member}
AND status = {int:is_active}',
array(
'current_member' => $id_member,
'is_active' => 1,
)
);

Then change it to this:

// Get all of the subscriptions for this user - it will be necessary!
$request = $smcFunc['db_query']('', '
SELECT id_subscribe, old_id_group
FROM {db_prefix}log_subscribed
WHERE id_member = {int:current_member}
AND status = {int:is_active}',
array(
'current_member' => $id_member,
'is_active' => 0,
)
);


The only change is the value in the array from 1 to 0. Now I have did some limited testing and everything seems fixed.

I created a user put them in two different subscriptions one active one finished.
Removed the active, finished stayed.
Wash and repeat removed finished, active stayed.

Everything seemed to work fine.

Remember to backup before you change anything.
BACKUP YOUR DATABASE TOO!!!!
Just in case something happens.

Thanks,
Siath

rsw686

Actually that fix just reverses the problem. I can not complete or delete active subscriptions only finished. The fix that worked for me was to replace that with


// Get all of the subscriptions for this user - it will be necessary!
$request = $smcFunc['db_query']('', '
SELECT id_subscribe, old_id_group
FROM {db_prefix}log_subscribed
WHERE id_member = {int:current_member}',
array(
'current_member' => $id_member,
)
);


This truly gets all subscriptions like the comment states.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

siath70

Well I think I found the problem with scheduled maintainence too.

It calls AND status = {int:not_active}',

I don't think not_active is a viable argument... At least for the other routine it threw errors saying it wasn't a valid argument.

Rsw686: Interesting way to handle it. I was able to remove an active with the code changes I proposed. Although, that could just be because they had an active and a finished. But, thats ok, I would rather not be able to remove actives, less mess ups and a little saftey built in.
I mean if I truely need to remove an active; I'll just check mark him, finish him and then delete.

Thanks,
Siath

rsw686

Quote from: siath70 on April 01, 2008, 10:37:59 AM
Rsw686: Interesting way to handle it. I was able to remove an active with the code changes I proposed. Although, that could just be because they had an active and a finished. But, thats ok, I would rather not be able to remove actives, less mess ups and a little saftey built in.

Well the complete selected button breaks with your fix. Yes I agree that it would be better to only be able to complete actives and deleted finished.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Advertisement: