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

Columns:: generatePageHook expects global \PageRegular #14

Closed
DanielSchwiperich opened this issue Jan 23, 2018 · 4 comments
Closed

Columns:: generatePageHook expects global \PageRegular #14

DanielSchwiperich opened this issue Jan 23, 2018 · 4 comments
Assignees
Labels

Comments

@DanielSchwiperich
Copy link

The hook expects a \PageRegular instead of a Contao\PageRegular which leads to something like

Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Type error: Argument 3 passed to MadeYourDay\\RockSolidColumns\\Columns::generatePageHook() must be an instance of PageRegular, instance of Ctsmedia\\Phpbb\\BridgeBundle\\PageType\\Forum

when a object is passed which extends Contao\PageRegular like for example our bridge forum type
https://github.com/ctsmedia/contao-phpbb-bridge-bundle/blob/master/src/PageType/Forum.php#L27

If I recall correctly Contao did this so that you could rewrite classes and it's only legacy stuff today.
Not sure if your module needs still to be compatible with this approach.
If not it should be changed for PageModel, LayoutModel and Database in this class too.

I could provide a PR for it, if you like

@ausi ausi closed this as completed in bdf323c Jan 24, 2018
@ausi
Copy link
Member

ausi commented Jan 24, 2018

Fixed in the master branch, could you please try "madeyourday/contao-rocksolid-columns": "dev-master as 2.0.1"?

If not it should be changed for PageModel, LayoutModel and Database in this class too.

I don’t think that the call to \Database::getInstance() has do be changed. If the contao framework is booted, \Database should always be available. It should only be relevant for parameter type hints.

@ausi ausi self-assigned this Jan 24, 2018
@ausi ausi added the bug label Jan 24, 2018
@DanielSchwiperich
Copy link
Author

thanks @ausi, looks good, will test it tomorrow

@DanielSchwiperich
Copy link
Author

Fix erfolgreich getestet. Danke @ausi

@ausi
Copy link
Member

ausi commented Jan 29, 2018

Released as Version 2.0.1.

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

No branches or pull requests

2 participants