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

Compatebillity with fork 5.9 #4

Open
Bernardusbron opened this issue May 14, 2021 · 5 comments
Open

Compatebillity with fork 5.9 #4

Bernardusbron opened this issue May 14, 2021 · 5 comments

Comments

@Bernardusbron
Copy link

I am new to Fork (installed fork and i made a theme using the theming guide) and i am trying the module guide now
(https://docs.fork-cms.com/documentation/detail/module-guide)

Installing this module gave a 500 error,
The installation proces isn't completed and if i go to edit group permissions i got following message (debug mode on)

Compile Error: Declaration of Backend\Modules\MiniBlog\Actions\Add::execute() must be compatible with Backend\Core\Engine\Base\Action::execute(): void

Where can i find how the new core works ? Because the documentation describes spoon and not Symfonie
Thanks in advance for pointing me in the right direction.

@Bernardusbron
Copy link
Author

I am also new to github so i don't now how this exactly works, i have changed the files in the backend actions folder by writing : void after the functions where the error occurs and now the error is not present anymmore in the permission section.

I deleted the mini blog database and removed the miniblog in the module part op the db and have installed the module again.

Now with the debugger on i have following list of error message

Symfony\Component\Debug\Exception\FatalThrowableError:
Type error: Argument 2 passed to Backend\Core\Installer\ModuleInstaller::insertExtra() must be an instance of Common\ModuleExtraType, string given, called in /customers/3/d/5/bernardusokan.be/httpd.www/src/Backend/Modules/MiniBlog/Installer/Installer.php on line 32

at src/Backend/Core/Installer/ModuleInstaller.php:491
at Backend\Core\Installer\ModuleInstaller->insertExtra('MiniBlog', 'block', 'MiniBlog')
(src/Backend/Modules/MiniBlog/Installer/Installer.php:32)
at Backend\Modules\MiniBlog\Installer\Installer->install()
(src/Backend/Modules/Extensions/Engine/Model.php:699)
at Backend\Modules\Extensions\Engine\Model::installModule('MiniBlog')
(src/Backend/Modules/Extensions/Actions/InstallModule.php:39)
at Backend\Modules\Extensions\Actions\InstallModule->execute()
(src/Backend/Core/Engine/Action.php:63)
at Backend\Core\Engine\Action->execute()
(src/Backend/Core/Engine/Backend.php:25)
at Backend\Core\Engine\Backend->display()
(app/ForkController.php:106)
at ForkCMS\App\ForkController->handleApplication(object(Backend))
(app/ForkController.php:54)
at ForkCMS\App\ForkController->backendController()
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(app/Kernel.php:53)
at ForkCMS\App\Kernel->handle(object(Request))
(index.php:59)

I am new to modules and symfony, so i don't know what to do with line 32 of the installer.php file.
This are also my first steps with object orientated programming, i did a lot of php programming on the old fashion way.
Thanks in advance for some assistence

@Bernardusbron
Copy link
Author

With some search i found ModuleExtraType in a facebook module here at Github and changed in the installer the string 'widget' and 'block' with this function and tried again. It looks like it's working now.
I forked this and added the changed files.

now i am getting problems with symfony

Symfony\Component\Debug\Exception\ClassNotFoundException:
Attempted to load class "DataGridDB" from namespace "Backend\Core\Engine".
Did you forget a "use" statement for another namespace?

at src/Backend/Modules/MiniBlog/Actions/Index.php:59
at Backend\Modules\MiniBlog\Actions\Index->loadDataGrid('Y')
(src/Backend/Modules/MiniBlog/Actions/Index.php:44)
at Backend\Modules\MiniBlog\Actions\Index->execute()
(src/Backend/Core/Engine/Action.php:63)
at Backend\Core\Engine\Action->execute()
(src/Backend/Core/Engine/Backend.php:25)
at Backend\Core\Engine\Backend->display()
(app/ForkController.php:106)
at ForkCMS\App\ForkController->handleApplication(object(Backend))
(app/ForkController.php:54)
at ForkCMS\App\ForkController->backendController()
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(app/Kernel.php:53)
at ForkCMS\App\Kernel->handle(object(Request))
(index.php:59)

@jessedobbelaere
Copy link
Member

hi @Bernardusbron I see that this module still uses TPL files for templates and not Twig, so I fear it's very outdated. Also given that the last commit was 6 to 8 years ago.

I think the docs need a full rewrite when Fork CMS v6 is released (afaik later this year) because some pages are outdated. The best way to learn how modules work is to look at the core modules like FAQ or ContentBlocks or MediaLibrary. These modules group their logic in the different domains with a command bus, and use Doctrine to query the database. Modules like Blog (in the core) are still using the older way without Doctrine.

https://github.com/friends-of-forkcms is also a good place to check for modules

@Bernardusbron
Copy link
Author

Thanks @jessedobbelaere I am going to look at one of the modules from the core you propose and learn how symfony works.
The friends of fork page is indeed also interesting, i found there already some brand new modules that look interesting.

It's a steep learning curve from standard php, html, mysql, javascript and using sometimes a 1 click install of another popular CMS system and now learning fork cms with symfony and twig integration.

@jessedobbelaere
Copy link
Member

Awesome! Feel free to join slack to ask questions. The nice thing about Symfony and Fork CMS is that it allows for easy custom development once you know your way around, so e.g. I always create a custom theme and sometimes custom modules for the websites I create

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

2 participants