Opened 8 years ago

Closed 7 years ago

#1418 closed task (fixed)

Post from groups moving to general forum.

Reported by: peregri Owned by: mahouni
Priority: major Milestone: 0.7
Component: BW Forum Keywords: group, forum
Cc:

Description

When a post created on a group is edited, and updated, the post shows up in the general forum, out of the group.

Attachments (1)

1418-editing-group-posts.patch (1.1 KB) - added by mahouni 7 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 8 years ago by peregri

The post loose the reference to the group where it belongs, when the post is updated later on.

comment:2 Changed 7 years ago by mahouni

  • Type changed from bug to developer task

It happens that groups topics disappear from groups but the topics are still in the forum. This is because the thread loses its group-id after editing.

When someone wants to edit a topic from a group, the group-id is available in forums/templates/editcreateform.php as $vars['IdGroup'].

If a new topic is created the group-id is known as $groupsforum.

So in line 194, it is asked:

if ($groupsforum)

and in line 195 value is set to $groupform if true. If $groupform is false (e.g when the topic is not in a group): value is set to 0 in line 197.

However $groupform is FALSE when editing! But if the Group-id already exists (as $vars['IdGroup'] it is NOT used in the form.

Therefore somehow after line 194 we need something like:

ELSE IF  (isset($vars['IdGroup'])

and if this condition is true then set the value to the existing group-id:

value="$vars['IdGroup']"

Please note: This is just guessing and I haven't tested it, I don't have a local install of BWRox. And I don't know the correct syntax in PHP...

Last edited 7 years ago by mahouni (previous) (diff)

comment:3 Changed 7 years ago by mahouni

  • Milestone changed from unassigned to 0.5.9 - bugfixing

comment:4 Changed 7 years ago by planetcruiser

hi mahouni, thanks for looking into this. so, do i understand correctly that you won't commit a patch? if so, who will? we should only attach tickets to the next milestone if a developer committed to solve the issue until the milestone release date.

do you need help with setting up a local copy and committing a fix?

comment:5 Changed 7 years ago by mahouni

  • Milestone changed from 0.5.9 - bugfixing to unassigned

comment:6 Changed 7 years ago by mahouni

Code review and testing needed:
attached a patch

Last edited 7 years ago by mahouni (previous) (diff)

Changed 7 years ago by mahouni

comment:7 Changed 7 years ago by planetcruiser

  • Milestone changed from unassigned to 0.7
  • Owner set to mahouni
  • Status changed from new to assigned

patch looks good, please add spaces around the operators and commit.

!=0

should be

! = 0

and

'.$vars['IdGroup'].'

' . $vars['IdGroup'] . '

maybe also consider an intval() around $vars['IdGroup']

comment:8 Changed 7 years ago by planetcruiser

looks like this was fixed via:

has this been successfully tested on alpha yet? if yes, please close this ticket.

comment:9 Changed 7 years ago by mahouni

  • Resolution set to fixed
  • Status changed from assigned to closed

successfully tested on alpha. I'll close this ticket now...

Note: See TracTickets for help on using tickets.