MyBB Community Forums
[F] Promotions - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: Archived Bug Reports (https://community.mybb.com/forum-74.html)
+------ Forum: MyBB 1.4.2 (https://community.mybb.com/forum-100.html)
+------ Thread: [F] Promotions (/thread-40153.html)



[F] Promotions - labrocca - 11-07-2008

There are some bugs in Promotion system.

I had a user in a custom group as primary.

I have 2 promotions setup.

One is for post count being 250, only users from Registered group, and they are promoted as secondary to a "Vetted" group. Now I have a user that was promoted from my l33t group which was his primary.

Not sure how this bug occured but it's just the past few days I am setting up promotions to see how they go and so far it's iffy.

Also the promotion logs...they only show last 20 actions without any pagination. I assume that it's missing the pagination. So at least that's one bug for sure.

OH WTF! I just was checking the promotion log in phpmyadmin to see the table directly...check this out:

[Image: 229-110608-174647.png]

Now not sure what's going on there but that column for "oldusergroup" is alarming...it appears that the promotion system is removing all secondaries instead of just adding it.

The log doesn't show what it's doing for primary but as my user is saying and I know for fact..he was in my l33t group as primary and now he is reverted to "registered" group.

For now I have to shut the system off as I can't have my paid subscribers in my VIP group reverted to regular membership. Keep in mind I have promotion setup ONLY to promote users from the group "registered"

I have about 35 members promoted and as you can see from that screenshot a lot of them have lost their additional groups.

The uid of the person is 24898 and you can see he is promoted twice in the screenshot but it's actually 4 times total in logs. Each time it's from group 20 to group 20 (20=vetted).

So again..not sure how this is happening. I am looking into file now.

More craziness btw:

[Image: 921-110608-180858.png]

You can see how many times this one user was promoted over and over and over again. His first promotion doesn't even show an oldusergroup so I assume that's where the problems begin for removing him.

Here are more promotions where oldusergroup isn't logged:

[Image: 593-110608-181207.png]

For now I have to disable the promotions but I hope this gets fixed and looked at asap before next release. The promotion system is a great addition for 1.4x. If Ryan you need phpmyadmin access let me know or dumps of certain tables.

Here are the sql of my promotion table.

INSERT INTO `mybb_promotions` VALUES(1, 'Vetted by Post Count', 'This will add you to vetted group if you have more than 250 posts.', 0, 1, 250, '>=', 0, 'days', 0, '>', 'postcount', '2', 20, 'secondary');
INSERT INTO `mybb_promotions` VALUES(2, 'Vetted by Reputation', 'This adds you to Vetted group by your reputation.', 0, 1, 0, '>', 0, 'days', 10, '>=', 'reputation', '2', 20, 'secondary');

And I have made no previous adjustments to the promotion system..it's default 1.4.3 files.

Big mess..I would like to help get this resolved as quickly as possible so let me know how I can help. I will subscribe to this thread.

EDIT: Ahh...just realized some logic flaws. The reason some are repeated promoted is because the Registered group is not promoted but instead the secondary is promoted. Seems a check to see if the person is already inside the target promotions should be added to avoid repeats (NOT IN statemet). So that should help fix up the repeats at least.

Sorry this post is so long too.


RE: Promotions - Ryan Gordon - 11-07-2008

if you could put some debugging logging code in the task i.e. file_put_contents(..debug stuff..) that would help a lot.

Look for what $sql_where and $usergroup_select and $uids turns out to be for each promotion in the debug log.

You can comment out the $db->update_query and join_usergroup so it doesn't actually take effect.


RE: Promotions - labrocca - 11-07-2008

Alright...give me a few minutes. I will do that and renable the tasks..also alter the promotion from 250 posts to 25 so more users get placed. It's active site so logs should roll in.


RE: Promotions - Dude106 - 11-07-2008

Funny, I've never had problems with the MyBB 1.4.3 Promotions...


RE: Promotions - labrocca - 11-07-2008

I am sure I am using it in a way that's a bit out of the ordinary. I am promoting a secondary group only based on a primary group. Also many of my users have up to 8 additional secondary groups which now appear to get deleted. You just might not notice if you don't have a lot of secondaries for your members.
Okay trying my best here...

				$log_inserts[] = array(
					'pid' => $promotion['pid'],
					'uid' => $user['uid'],
					'oldusergroup' => $user['additionalgroups'],
					'newusergroup' => $promotion['newusergroup'],
					'dateline' => TIME_NOW,
					'type' => "secondary",
				);

Seems that needs to be sure that "newusergroup" also adds original groups to "newusergroup" and not just the promotion group. The query before it needs to check to see if the user is already in the newgroup to avoid duplication.

I have some debugging setup so if you want to hop on IM with me we can work some of this out hopefully.
Well looks like my report is part Bug and part Bogus. Ryan has helped me sort some things out.

1. admincp doesn't paginate for promotion logs
2. the promotion system under certain circumstances will repeatedely promote a user which just wastes a query and adds a log entry

Doesn't appear that additional groups are overwritten as I had thought though.

Thank to Ryan Gordon for his efforts and patience.

Hopefully he will post bug fixes here soon enough.


RE: Promotions - Ryan Gordon - 11-07-2008

Okay so it ended up just being a logging problem in the end

Since it's not possible to check to see if the usergroup we want to promote is already in the additionalgroups field (since it's a text field and with an unordered list like "5,4,2,8,54,6") the logging was inserting extraneous fields. I found a way to workaround this and implemented it for 1.4.4

The pagination issue is still being looked into


[F] Promotions - Ryan Gordon - 11-10-2008

Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group