Menu

#353 Attributes apper two times

5.1.3
closed
bug
2017-10-18
2017-09-30
No

Hi Uwe,

following lines apper two times in out.AddDocument.php:
I did not check if they are 100% identical, but at least attributes are shown two times.

$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
            if($attrdefs) {
                foreach($attrdefs as $attrdef) {
                    $arr = $this->callHook('addDocumentAttribute', null, $attrdef);
                    if(is_array($arr)) {
                        if($arr) {
                            echo "<tr>";
                            echo "<td>".$arr[0].":</td>";
                            echo "<td>".$arr[1]."</td>";
                            echo "</tr>";
                        }
                    } else {
?>
        <tr>
            <td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
            <td><?php $this->printAttributeEditField($attrdef, '') ?></td>
        </tr>
<?php
                    }
                }
            }

Discussion

  • Marek Lerawski

    Marek Lerawski - 2017-09-30

    Sorry, I meant class.AddDocument.php in views/bootstrap ...

     
  • Uwe Steinmann

    Uwe Steinmann - 2017-10-11

    Sure? I don't see the duplication. There are very similar code blocks, because both documents and document contents can have attributes. If an attribute is defined to usable by all object types (document, content, folder) it will actually show up twice in the form.

     
  • Marek Lerawski

    Marek Lerawski - 2017-10-13

    OK, sorry, you are absolutely right. It is one for the document and one for the document version. Ticket can be closed!

     
  • Uwe Steinmann

    Uwe Steinmann - 2017-10-18
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB