Jump to content


Photo

Tags are incorrect when rebuilding topics


We have this in sortTopic

                if( !$_POST['ipsTags'] )
                {
                    $this->DB->build( array( 'select' => '*', 'from' => 'core_tags', 'where' => "tag_meta_app='downloads' AND tag_meta_area='files' AND tag_meta_id=" . $file['file_id'] ) );
                    $this->DB->execute();
                   
                    while( $r = $this->DB->fetch() )
                    {
                        $_POST['ipsTags'][]    = $r['tag_text'];
                    }
                }

Basically, if you're not submitting a new file, it's reading the tags from the database..

However.. This is in a while.. So, $_POST['ipsTags'] never gets reset.

So, it hits the first topic with a tag, and every subsequent one.. Gets the same tags.

I added

$_POST['ipsTags'] = '';   

Right above the return true on it.. But.. Something tells me I'm missing something that may cause a problem here..

Status: Fixed
Version: 2.5.1
Fixed In: 2.5.2


1 Comments

Your fix is ok, but instead of adding it in sortTopic() at the end, I added the reset in tools.php when rebuilding topics. This is the only time I can foresee this being an issue. Basically, added $_POST['ipsTags'] = null; right before each call to sortTopic() in tools.php.