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

Craft 5 compatible version #16

Closed
wants to merge 4 commits into from
Closed

Conversation

bencroker
Copy link
Contributor

@bencroker bencroker commented Feb 10, 2024

I initially though that adding support for Craft 5 would just be a matter of updating composer requirements, but it turns out that the content table changes need addressing.

Specifically the RenderCompiledClasses::handle() method:

public function handle($forceRecreate = false)
{
$contentService = \Craft::$app->getContent();
$originalContentTable = $contentService->contentTable;
$originalFieldColumnPrefix = $contentService->fieldColumnPrefix;
$originalFieldContext = $contentService->fieldContext;
$contentService->contentTable = Table::CONTENT;
$contentService->fieldColumnPrefix = 'field_';
$contentService->fieldContext = 'global';
$this->render($forceRecreate);
$contentService->contentTable = $originalContentTable;
$contentService->fieldColumnPrefix = $originalFieldColumnPrefix;
$contentService->fieldContext = $originalFieldContext;
return true;
}

@bencroker bencroker changed the title Add Craft 5.0.0-beta.1 to composer requirements Craft 5 compatible version Feb 10, 2024
@bencroker bencroker closed this Feb 10, 2024
@bencroker bencroker deleted the patch-1 branch February 10, 2024 01:58
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

Successfully merging this pull request may close these issues.

1 participant