stable
Clone or download
Fix request #35465 Docman error when accessing a document in default template
Given a document added to the Tuleap Default Template project, then an error is raised: FastCGI sent in stderr : PHP warning : undefined array key 0 in (...)/Docman_MetadataListOfValuesElementFactory.class.php on line 355 PHP Fatal error : Uncaught Error: Call to a member function getId() on null in /usr/share/tuleap/plugins/docman/include/REST/v1/Metadata/MetadataRepresentationBuilder.php:114 This occurs because the install.sql initiates this docman with a status set to 0, which is an unknown value. Having this particular value must return the None status. Note: Nothing is done for other unknown value than 0, because other unknown value must not exist and we want to have them raised to us instead of being hidding behind a default value. Change-Id: Id0a0ddfe2e03bb098b1b963ab5efa24baffefbdb
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/docman/db/install.sql | +1 | −1 | Go to diff View file |
M | plugins/docman/include/Docman_MetadataListOfValuesElementFactory.class.php | +3 | −0 | Go to diff View file |
M | plugins/docman/tests/unit/Metadata/MetadataListOfValuesElementFactoryTest.php | +109 | −49 | Go to diff View file |