humhub / rest

HumHub Rest API Module
24 stars 24 forks source link

Getting unknown property: humhub\\modules\\content\\models\\Content::locked_comments #88

Closed donni106 closed 2 years ago

donni106 commented 2 years ago

I updated to 0.5.0 and now i get error results when getting posts for space container where posts exist:

{
    "name": "Unknown Property",
    "message": "Getting unknown property: humhub\\modules\\content\\models\\Content::locked_comments",
    "code": 0,
    "type": "yii\\base\\UnknownPropertyException",
    "file": "/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Component.php",
    "line": 155,
    "stack-trace": [
        "#0 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(298): yii\\base\\Component->__get('locked_comments')",
        "#1 /var/www/localhost/htdocs/protected/modules/rest/definitions/ContentDefinitions.php(47): yii\\db\\BaseActiveRecord->__get('locked_comments')",
        "#2 /var/www/localhost/htdocs/protected/modules/rest/definitions/ContentDefinitions.php(28): humhub\\modules\\rest\\definitions\\ContentDefinitions::getContentMetadata(Object(humhub\\modules\\content\\models\\Content))",
        "#3 /var/www/localhost/htdocs/protected/modules/rest/definitions/PostDefinitions.php(24): humhub\\modules\\rest\\definitions\\ContentDefinitions::getContent(Object(humhub\\modules\\content\\models\\Content))",
        "#4 /var/www/localhost/htdocs/protected/modules/rest/controllers/post/PostController.php(33): humhub\\modules\\rest\\definitions\\PostDefinitions::getPost(Object(humhub\\modules\\post\\models\\Post))",
        "#5 /var/www/localhost/htdocs/protected/modules/rest/components/BaseContentController.php(115): humhub\\modules\\rest\\controllers\\post\\PostController->returnContentDefinition(Object(humhub\\modules\\post\\models\\Post))",
        "#6 [internal function]: humhub\\modules\\rest\\components\\BaseContentController->actionFindByContainer('84')",
        "#7 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)",
        "#8 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Controller.php(181): yii\\base\\InlineAction->runWithParams(Array)",
        "#9 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Module.php(534): yii\\base\\Controller->runAction('find-by-contain...', Array)",
        "#10 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/web/Application.php(104): yii\\base\\Module->runAction('rest/post/post/...', Array)",
        "#11 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Application.php(392): yii\\web\\Application->handleRequest(Object(humhub\\components\\Request))",
        "#12 /var/www/localhost/htdocs/index.php(25): yii\\base\\Application->run()",
        "#13 {main}"
    ]
}

i am not sure, if this is related to 0.5.0, but i do not know about any other changes or udpated configs.

using HumHub Community Edition Version: 1.8.3

donni106 commented 2 years ago

Reverting to 0.4.3 works again. I have downloaded https://github.com/humhub/rest/releases/tag/v0.4.3 and put it in my installed instance. Additionally i needed to uninstall the 0.5.0 module to make the 0.4.3 visible in order to activate it. So please take care of the bug and inform we once a new version is out. Thanks!

yurabakhtin commented 2 years ago

@donni106 Yes, you are right we added in response new content columns here https://github.com/humhub/rest/pull/86/commits/0efdaece6d998c62a9033dc18cf4cae204b2a043#diff-c3b324e68fe919cca901505ab531fd1bdf9a46c645850a4c895af68dcbdd8e86R47

What HumHub version do you use? The Content field locked_comments was added here https://github.com/humhub/humhub/commit/01270ff#diff-b035dbac3239b41d6820053cd38eb34872b4881a9d7ecc0eca6a7ff3b73e5945R15 for HumHub version 1.10.

@luke- Should we increase min HumHub version for the REST module to 1.10, or modify the code to something like? :

donni106 commented 2 years ago

thanks, good info!

using HumHub Community Edition Version: 1.8.3

i would need to invest further if i can safely update to at least 1.10, but will keep you up to date if i did and everything worked out well.

luke- commented 2 years ago

@yurabakhtin Let's increase the min version of the REST API

donni106 commented 2 years ago

nice, now the module is listed with "last compatible version 0.4.3" for my 1.8.3 HumHub instance

luke- commented 2 years ago

That is correct or not? The new version 0.5.1 with "locked_comments" requires at least HumHub 1.10.

donni106 commented 2 years ago

yes, it's perfect now! just wanted to confirm it for my case.

luke- commented 2 years ago

Ok, thanks! :-)