Avatar

"edited by" in 2.3.7 Shows wrong if post is moved category (Bugs)

by Auge ⌂, Saturday, December 10, 2016, 16:01 (2684 days ago) @ Micha

Hello

I believe, the if-statement is the problem.


Are you sure?

Check it. ;-)

Meanwhile I dit it (without a live test!). What bugs me is the logic of the single blocks. Let me formulate this with words.

If the acting user is an admin and his edits should not be mentioned or the acting user is an mod and his edits should not be mentioned or the content of the text and subject fields are not changed and the user-id stays the same or the name is unchanged and the location stays the same and the acting user is an admin and his edits should not be mentioned or the acting user is an mod and his edits should not be mentioned.

What the fuck!?

@Alex: what was your intention?

Not to forget the tail.

Else if the acting user is a registered user.

Else. <= That seems to be the block where an editing admin lands, if his actions should not be hidden and if he changes only the category.

I try to put the blocks into parenthesis, like I think it's logical for me. Please remind the additional parenthesis.

The user is an admin and his edits should not be mentioned:

 
(isset($_SESSION[$settings['session_prefix'].'user_type'])
 && $_SESSION[$settings['session_prefix'].'user_type'] == 2
 && $settings['dont_reg_edit_by_admin'] == 1)

The user is an admin and his edits should not be mentioned:

(isset($_SESSION[$settings['session_prefix'].'user_type'])
 && $_SESSION[$settings['session_prefix'].'user_type'] == 1
 && $settings['dont_reg_edit_by_mod'] == 1)

In both cases all three conditions have to apply. Thatswhy I think, the additional parenthesis to enclose these conditions are correct.

if ((isset($_SESSION[$settings['session_prefix'].'user_type'])
  && $_SESSION[$settings['session_prefix'].'user_type'] == 2
  && $settings['dont_reg_edit_by_admin'] == 1)
 or (isset($_SESSION[$settings['session_prefix'].'user_type'])
  && $_SESSION[$settings['session_prefix'].'user_type'] == 1
  && $settings['dont_reg_edit_by_mod'] == 1)
 /* additional conditions */)

At that point the additional condition block enters the game. Here it is:

or (the content of the text and subject fields are not changed and (the user-id stays the same or the name is unchanged) and the location stays the same and (the acting user is an admin and his edits should not be mentioned or the acting user is an mod and his edits should not be mentioned)).

IF ((text == text)
   AND (subject == subject)
   AND ((user_id == user_id) OR (name == name))
   AND (location == location)
   AND ((acting_user == admin) OR (acting_user == mod)))

What the heck should this special case stand for? And why should I give special attention to this case, where nothing changes and the acting admins or mods edits should stay hidden, exactly like in the first two conditions, that stated that we enters the block, when the acting admins or mods edits should stay hidden?

Is there something like a hidden, wonderful or mysterious feature, I miss?

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!


Complete thread:

 RSS Feed of thread