Ticket #1418 (closed developer task: fixed)

Opened 19 months ago

Last modified 13 days ago

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

1418-editing-group-posts.patch Download (1.1 KB) - added by mahouni 5 weeks ago.

Change History

comment:1 Changed 19 months ago by peregri

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

comment:2 Changed 2 months 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 2 months ago by mahouni (previous) (diff)

comment:3 Changed 2 months ago by mahouni

  • Milestone changed from unassigned to 0.5.9 - bugfixing

comment:4 Changed 2 months 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 8 weeks ago by mahouni

  • Milestone changed from 0.5.9 - bugfixing to unassigned

comment:6 Changed 5 weeks ago by mahouni

Code review and testing needed:
attached a patch

Last edited 5 weeks ago by mahouni (previous) (diff)

Changed 5 weeks ago by mahouni

comment:7 Changed 5 weeks ago by planetcruiser

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

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 2 weeks 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 13 days ago by mahouni

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

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

Note: See TracTickets for help on using tickets.