News:

Wondering if this will always be free?  See why free is better.

Main Menu

Modifying post count group

Started by Sir Osis of Liver, October 12, 2024, 05:44:59 PM

Previous topic - Next topic

Sir Osis of Liver

In response to this post, post count group can be modified to Private, this adds it to newsletter membergroups.  If you try to change it back to Post Based it fails with this error -

Fatal error: Uncaught TypeError: abs(): Argument #1 ($num) must be of type int|float, string given in /home/thekrash/domains/thekrashsite.com/public_html/smf21core/Sources/ManageMembergroups.php:740 Stack trace: #0 /home/thekrash/domains/thekrashsite.com/public_html/smf21core/Sources/ManageMembergroups.php(740): abs() #1 /home/thekrash/domains/thekrashsite.com/public_html/smf21core/Sources/Subs.php(6030): EditMembergroup() #2 /home/thekrash/domains/thekrashsite.com/public_html/smf21core/Sources/ManageMembergroups.php(66): call_helper() #3 /home/thekrash/domains/thekrashsite.com/public_html/smf21core/Sources/Admin.php(499): ModifyMembergroups() #4 /home/thekrash/domains/thekrashsite.com/public_html/smf21core/index.php(184): AdminMain() #5 {main} thrown in /home/thekrash/domains/thekrashsite.com/public_html/smf21core/Sources/ManageMembergroups.php on line 740

Steps to replicate -

Admin > Members > Membergroups.  Modify post count group to Private - works.  Modify back to Post Based, fails.
When in Emor, do as the Snamors.
                              - D. Lister

Kindred

It's not actually a bug..    well, the error is,  but you should not be able to change it back,  since post count based groups are special and have a variable membership
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Maybe shouldn't have an option to change it at all.
When in Emor, do as the Snamors.
                              - D. Lister

Aleksi "Lex" Kilpinen

#3
I'd agree, if it works one way it should work the other way too. Or if for some reason that wouldn't be possible, then it shouldn't be an option at all.

#8324
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Arantor

The reason it fails trying to put it back is that it no longer knows how many posts are the new baseline, from what I can tell.

But it shouldn't let you change it because post type groups aren't hidden anywhere in the system (the hidden logic literally can't apply to them)
Holder of controversial views, all of which my own.


KittyGalore

Quote from: Aleksi on October 13, 2024, 02:43:19 AMI'd agree, if it works one way it should work the other way too. Or if for some reason that wouldn't be possible, then it shouldn't be an option at all.

#8324
Also get the error strange you can select all the other options Protected and Requestable and so on but won't go to post count.
SMF Curve 2.0x

Kindred

Not strange  at all..   because it would break the system

It should not even allow you to change it in the first place.

The bug here is not the failure to change back,  or even the error...  the bug is allowing the first change at all.

I guess we never thought anyone would do that,  so it never even occurred to us to test it.

You should never be able to change a group from Post count based to assigned or from assigned to post count based
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

KittyGalore

Quote from: Kindred on October 13, 2024, 08:32:53 AMNot strange  at all..  because it would break the system

It should not even allow you to change it in the first place.

The bug here is not the failure to change back,  or even the error...  the bug is allowing the first change at all.

I guess we never thought anyone would do that,  so it never even occurred to us to test it.

You should never be able to change a group from Post count based to assigned or from assigned to post count based
Clearly the post count group should have been made separate to the others so the option to change it isn't there and not having it in that list so avoiding the error.
SMF Curve 2.0x

Kindred

That's what I just said.

We never tested it because it never even occurred to us that someone would try that,  since it's illogical (imnsho)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

It's not even illogical: it's a literal achieve-nothing operation because there is literally no handling anywhere for the concept of a private post count group, because post-count groups don't have the same visibility as regular groups.

Serious question: what would you as an admin envisage the concept of a 'private post count' group even mean? It's not like you can be in multiple post count groups at once.
Holder of controversial views, all of which my own.


Sir Osis of Liver

If you look at the referenced topic you'll see there was a legitimate reason to try it.  It can't be reversed, once you modify the post count group it can't be restored as such.  The option should be removed.
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

No, there wasn't a legitimate reason to try it, when there was already the functionality you wanted.

But again, what does a "private post group" look like?
Holder of controversial views, all of which my own.


Sir Osis of Liver

Quote from: Arantor on October 14, 2024, 03:01:08 AMNo, there wasn't a legitimate reason to try it, when there was already the functionality you wanted.

Yeah, well, if I knew that ..........
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

Funnily enough it's been the same for 20 years - 1.1 and 2.0 both behave this way as well...
Holder of controversial views, all of which my own.


Sir Osis of Liver

Well, either it never came up before, or I don't remember it (there's much I don't remember :( ).

Hey, we're at 2.1.5.  :)

When in Emor, do as the Snamors.
                              - D. Lister

Jeff Lewis

Co-Founder of SMF

Arantor

2.1.5 has been on this site for a while, while some bugs are ironed out on it.
Holder of controversial views, all of which my own.


Advertisement: