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

Astroid throws error while creating article by Joomla 4 API #216

Closed
BoxSo opened this issue Oct 10, 2022 · 4 comments
Closed

Astroid throws error while creating article by Joomla 4 API #216

BoxSo opened this issue Oct 10, 2022 · 4 comments
Milestone

Comments

@BoxSo
Copy link

BoxSo commented Oct 10, 2022

using the astroid framework works like a charm. We now tried creating articles by using the joomla 4 api and the server throws an error 500 cause of an "undefined constant":

{ "errors": { "code": 500, "title": "Internal server error", "detail": "Error: Undefined constant \"Astroid\\Helper\\ASTROID_JOOMLA_VERSION\" in /<<localPath>>/httpdocs/libraries/astroid/framework/library/astroid/Helper/Client.php:207\nStack trace:\n#0 /<<localPath>>/httpdocs/plugins/system/astroid/astroid.php(54): Astroid\\Helper\\Client->onContentPrepareForm()\n#1 /<<localPath>>/httpdocs/libraries/src/Plugin/CMSPlugin.php(279): plgSystemAstroid->onContentPrepareForm()\n#2 /<<localPath>>/httpdocs/libraries/vendor/joomla/event/src/Dispatcher.php(486): Joomla\\CMS\\Plugin\\CMSPlugin->Joomla\\CMS\\Plugin\\{closure}()\n#3 /<<localPath>>/httpdocs/libraries/src/Application/EventAware.php(107): Joomla\\Event\\Dispatcher->dispatch()\n#4 /<<localPath>>/httpdocs/libraries/src/MVC/Model/FormBehaviorTrait.php(169): Joomla\\CMS\\Application\\WebApplication->triggerEvent()\n#5 /<<localPath>>/httpdocs/administrator/components/com_content/src/Model/ArticleModel.php(1034): Joomla\\CMS\\MVC\\Model\\FormModel->preprocessForm()\n#6 /<<localPath>>/httpdocs/libraries/src/MVC/Model/FormBehaviorTrait.php(107): Joomla\\Component\\Content\\Administrator\\Model\\ArticleModel->preprocessForm()\n#7 /<<localPath>>/httpdocs/administrator/components/com_content/src/Model/ArticleModel.php(466): Joomla\\CMS\\MVC\\Model\\FormModel->loadForm()\n#8 /<<localPath>>/httpdocs/libraries/src/MVC/Controller/ApiController.php(420): Joomla\\Component\\Content\\Administrator\\Model\\ArticleModel->getForm()\n#9 /<<localPath>>/httpdocs/libraries/src/MVC/Controller/ApiController.php(316): Joomla\\CMS\\MVC\\Controller\\ApiController->save()\n#10 /<<localPath>>/httpdocs/libraries/src/MVC/Controller/BaseController.php(672): Joomla\\CMS\\MVC\\Controller\\ApiController->add()\n#11 /<<localPath>>/httpdocs/libraries/src/Dispatcher/ApiDispatcher.php(61): Joomla\\CMS\\MVC\\Controller\\BaseController->execute()\n#12 /<<localPath>>/httpdocs/libraries/src/Component/ComponentHelper.php(355): Joomla\\CMS\\Dispatcher\\ApiDispatcher->dispatch()\n#13 /<<localPath>>/httpdocs/libraries/src/Application/ApiApplication.php(405): Joomla\\CMS\\Component\\ComponentHelper::renderComponent()\n#14 /<<localPath>>/httpdocs/libraries/src/Application/ApiApplication.php(113): Joomla\\CMS\\Application\\ApiApplication->dispatch()\n#15 /<<localPath>>/httpdocs/libraries/src/Application/CMSApplication.php(294): Joomla\\CMS\\Application\\ApiApplication->doExecute()\n#16 /<<localPath>>/httpdocs/api/includes/app.php(53): Joomla\\CMS\\Application\\CMSApplication->execute()\n#17 /<<localPath>>/httpdocs/api/index.php(31): require_once('...')\n#18 {main}" } }

Any ideas how to get rid of this error or any kind of workaround?

@sonvnn
Copy link
Member

sonvnn commented Oct 11, 2022

Hi @BoxSo

I fixed issue on cf27587
Please help me download developer branch and upload to your site https://github.com/templaza/astroid-framework/archive/refs/heads/developer.zip

Please help me test it again.

Thanks & Best Regards,
Sonny

@BoxSo
Copy link
Author

BoxSo commented Oct 11, 2022

Hi @sonvnn ,

tested it with manually changing the file you've changed with your code.
Works now, i can create an article by using the Joomla API

@sonvnn
Copy link
Member

sonvnn commented Oct 12, 2022

Thank you! I close this issue as resolved

@sonvnn sonvnn closed this as completed Oct 12, 2022
@sonvnn sonvnn added this to the Version 2.6.2 milestone Oct 12, 2022
@Chacapamac
Copy link
Collaborator

Check This JCE Post —> https://www.joomlacontenteditor.net/support/forum/111990-i-can-t-use-the-styles-lis-on-astroid-template-one

Yep, work for me also! with;
JCE Pro 2.9.31 Beta 6 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

and above Astroid Developer branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants