Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling removeDuplicatePropertyValues() on some elementary datatypes crashes Skosmos #1635

Closed
joelit opened this issue Jun 28, 2024 · 1 comment · Fixed by #1674
Closed
Labels
Milestone

Comments

@joelit
Copy link
Contributor

joelit commented Jun 28, 2024

URL address of the page where you encountered the problem

On Skosmos 2.18, but this needs to be tested on Skosmos 3.0

On a KOKO concept page with owl:deprecated true.
In this case it was at https://dev.finto.fi/koko/fi/page/p1330 but the data has changed since.

Description of the problem

Uncertain of the exact conditions for reproduction. In general, when calling Concept->removeDuplicatePropertyValues() on a Concept which has booleans as a property value, this causes a PHP Fatal error since PHP8. This behaviour has been reported before: https://bugs.php.net/bug.php?id=79623

Skosmos concepts can have strings, uriresources, booleans or numbers as their value. Skosmos code calls method_exists() function which only accepts strings or objects, and it's possible that elementary datatypes ere neither.

Additional information (e.g. screenshots) about the problem

Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given in /var/www/dev.finto.fi/model/Concept.php:663
Stack trace:
#0 /var/www/dev.finto.fi/model/Concept.php(663): method_exists()
#1 /var/www/dev.finto.fi/model/Concept.php(645): Concept->removeDuplicatePropertyValues()
#2 /var/www/dev.finto.fi/vendor/twig/twig/src/Extension/CoreExtension.php(1570): Concept->getProperties()
#3 /tmp/dev.finto.fi-template-cache/14/14195eb90970f3d82291e8b5206fbde97857f3ec07a811c6d30bb2e78e0c8bcd.php(400): twig_get_attribute()
#4 /var/www/dev.finto.fi/vendor/twig/twig/src/Template.php(405): __TwigTemplate_6cfe4edcf45ed4eafa80c27675c92860c18b44e7cea82694d18c63deca2a6327->doDisplay()
#5 /var/www/dev.finto.fi/vendor/twig/twig/src/Template.php(378): Twig\\Template->displayWithErrorHandling()
...
@osma
Copy link
Member

osma commented Aug 30, 2024

Fix for Skosmos 2 in PR #1673. Needs to be fixed in Skosmos 3 as well.

@osma osma added this to the 3.0 milestone Aug 30, 2024
@github-project-automation github-project-automation bot moved this from Selected for analysis to Closed in NatLibFi Skosmos Backlog Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

2 participants