Skip to content

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Aug 11, 2025

Question Answer
JIRA Ticket
Versions 5.0 only
Edition

Controller's action must be used with two colons or it throughs the error Controller "ibexa_content:viewAction" does neither exist as service nor as class.

See https://doc.ibexa.co/en/5.0/release_notes/ibexa_dxp_v5.0_deprecations/#ibexacore "Dropped single colon notation"

Notice that https://github.com/ibexa/core/blob/main/src/lib/MVC/Symfony/View/Builder/ContentViewBuilder.php#L73 still match on single colon.

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

`Controller "ibexa_content:viewAction" does neither exist as service nor as class.`

See https://doc.ibexa.co/en/5.0/release_notes/ibexa_dxp_v5.0_deprecations/#ibexacore "Dropped single colon notation"
`Controller "ibexa_content:viewAction" does neither exist as service nor as class.`

See https://doc.ibexa.co/en/5.0/release_notes/ibexa_dxp_v5.0_deprecations/#ibexacore "Dropped single colon notation"
`Controller "ibexa_content:viewAction" does neither exist as service nor as class.`

See https://doc.ibexa.co/en/5.0/release_notes/ibexa_dxp_v5.0_deprecations/#ibexacore "Dropped single colon notation"
Copy link

github-actions bot commented Aug 11, 2025

Preview of modified files

Preview of modified Markdown:

@adriendupuis adriendupuis requested a review from mnocon August 11, 2025 14:40
Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/front/render_content_in_php/src/Command/ViewCommand.php

docs/templating/render_content/render_content_in_php.md@24:```php hl_lines="57-61"
docs/templating/render_content/render_content_in_php.md@25:[[= include_file('code_samples/front/render_content_in_php/src/Command/ViewCommand.php') =]]
docs/templating/render_content/render_content_in_php.md@26:```

001⫶<?php declare(strict_types=1);
002⫶
003⫶namespace App\Command;
004⫶
005⫶use Ibexa\Core\MVC\Symfony\View\Builder\ContentViewBuilder;
006⫶use Ibexa\Core\MVC\Symfony\View\Renderer\TemplateRenderer;
007⫶use Symfony\Component\Console\Attribute\AsCommand;
008⫶use Symfony\Component\Console\Command\Command;
009⫶use Symfony\Component\Console\Input\InputInterface;
010⫶use Symfony\Component\Console\Input\InputOption;
011⫶use Symfony\Component\Console\Output\OutputInterface;
012⫶
013⫶#[AsCommand(
014⫶ name: 'app:view'
015⫶)]
016⫶class ViewCommand extends Command
017⫶{
018⫶ private ContentViewBuilder $contentViewBuilder;
019⫶
020⫶ private TemplateRenderer $templateRenderer;
021⫶
022⫶ public function __construct(
023⫶ ContentViewBuilder $contentViewBuilder,
024⫶ TemplateRenderer $templateRenderer
025⫶ ) {
026⫶ $this->contentViewBuilder = $contentViewBuilder;
027⫶ $this->templateRenderer = $templateRenderer;
028⫶
029⫶ parent::__construct();
030⫶ }
031⫶
032⫶ protected function configure(): void
033⫶ {
034⫶ $this->setDescription('Render the view of a content item')
035⫶ ->addOption('content-id', 'c', InputOption::VALUE_OPTIONAL, 'Content ID')
036⫶ ->addOption('location-id', 'l', InputOption::VALUE_OPTIONAL, 'Location ID')
037⫶ ->addOption('view-type', 't', InputOption::VALUE_OPTIONAL, 'View Type', 'line');
038⫶ }
039⫶
040⫶ protected function execute(InputInterface $input, OutputInterface $output): int
041⫶ {
042⫶ $contentId = $input->getOption('content-id');
043⫶ $locationId = $input->getOption('location-id');
044⫶ if (empty($contentId) && empty($locationId)) {
045⫶ throw new \InvalidArgumentException('No Content ID nor Location ID given');
046⫶ }
047⫶
048⫶ $viewParameters = [
049⫶ 'viewType' => $input->getOption('view-type'),

code_samples/front/render_content_in_php/src/Command/ViewCommand.php

docs/templating/render_content/render_content_in_php.md@24:```php hl_lines="57-61"
docs/templating/render_content/render_content_in_php.md@25:[[= include_file('code_samples/front/render_content_in_php/src/Command/ViewCommand.php') =]]
docs/templating/render_content/render_content_in_php.md@26:```

001⫶<?php declare(strict_types=1);
002⫶
003⫶namespace App\Command;
004⫶
005⫶use Ibexa\Core\MVC\Symfony\View\Builder\ContentViewBuilder;
006⫶use Ibexa\Core\MVC\Symfony\View\Renderer\TemplateRenderer;
007⫶use Symfony\Component\Console\Attribute\AsCommand;
008⫶use Symfony\Component\Console\Command\Command;
009⫶use Symfony\Component\Console\Input\InputInterface;
010⫶use Symfony\Component\Console\Input\InputOption;
011⫶use Symfony\Component\Console\Output\OutputInterface;
012⫶
013⫶#[AsCommand(
014⫶ name: 'app:view'
015⫶)]
016⫶class ViewCommand extends Command
017⫶{
018⫶ private ContentViewBuilder $contentViewBuilder;
019⫶
020⫶ private TemplateRenderer $templateRenderer;
021⫶
022⫶ public function __construct(
023⫶ ContentViewBuilder $contentViewBuilder,
024⫶ TemplateRenderer $templateRenderer
025⫶ ) {
026⫶ $this->contentViewBuilder = $contentViewBuilder;
027⫶ $this->templateRenderer = $templateRenderer;
028⫶
029⫶ parent::__construct();
030⫶ }
031⫶
032⫶ protected function configure(): void
033⫶ {
034⫶ $this->setDescription('Render the view of a content item')
035⫶ ->addOption('content-id', 'c', InputOption::VALUE_OPTIONAL, 'Content ID')
036⫶ ->addOption('location-id', 'l', InputOption::VALUE_OPTIONAL, 'Location ID')
037⫶ ->addOption('view-type', 't', InputOption::VALUE_OPTIONAL, 'View Type', 'line');
038⫶ }
039⫶
040⫶ protected function execute(InputInterface $input, OutputInterface $output): int
041⫶ {
042⫶ $contentId = $input->getOption('content-id');
043⫶ $locationId = $input->getOption('location-id');
044⫶ if (empty($contentId) && empty($locationId)) {
045⫶ throw new \InvalidArgumentException('No Content ID nor Location ID given');
046⫶ }
047⫶
048⫶ $viewParameters = [
049⫶ 'viewType' => $input->getOption('view-type'),
050⫶            '_controller' => 'ibexa_content:viewAction',
050⫶            '_controller' => 'ibexa_content::viewAction',
051⫶        ];
052⫶
053⫶ if (!empty($locationId)) {
054⫶ $viewParameters['locationId'] = $locationId;
055⫶ }
056⫶ if (!empty($contentId)) {
057❇️ $viewParameters['contentId'] = $contentId;
058❇️ }
059❇️
060❇️ // build view
061❇️ $contentView = $this->contentViewBuilder->buildView($viewParameters);
062⫶
063⫶ // render view
064⫶ $renderedView = $this->templateRenderer->render($contentView);
065⫶
066⫶ $output->writeln($renderedView);
067⫶
068⫶ return 0;
069⫶ }
070⫶}


code_samples/tutorials/page_tutorial/templates/blocks/form/newsletter.html.twig

docs/tutorials/page_and_form_tutorial/5_create_newsletter_form.md@48:``` html+twig hl_lines="1"
docs/tutorials/page_and_form_tutorial/5_create_newsletter_form.md@49:[[= include_file('code_samples/tutorials/page_tutorial/templates/blocks/form/newsletter.html.twig') =]]
docs/tutorials/page_and_form_tutorial/5_create_newsletter_form.md@50:```

001❇️<div class="row">
002⫶ <div class="block-form {{ block_class }}">
003⫶ {{ ibexa_http_cache_tag_relation_location_ids(locationId) }}
051⫶        ];
052⫶
053⫶ if (!empty($locationId)) {
054⫶ $viewParameters['locationId'] = $locationId;
055⫶ }
056⫶ if (!empty($contentId)) {
057❇️ $viewParameters['contentId'] = $contentId;
058❇️ }
059❇️
060❇️ // build view
061❇️ $contentView = $this->contentViewBuilder->buildView($viewParameters);
062⫶
063⫶ // render view
064⫶ $renderedView = $this->templateRenderer->render($contentView);
065⫶
066⫶ $output->writeln($renderedView);
067⫶
068⫶ return 0;
069⫶ }
070⫶}


code_samples/tutorials/page_tutorial/templates/blocks/form/newsletter.html.twig

docs/tutorials/page_and_form_tutorial/5_create_newsletter_form.md@48:``` html+twig hl_lines="1"
docs/tutorials/page_and_form_tutorial/5_create_newsletter_form.md@49:[[= include_file('code_samples/tutorials/page_tutorial/templates/blocks/form/newsletter.html.twig') =]]
docs/tutorials/page_and_form_tutorial/5_create_newsletter_form.md@50:```

001❇️<div class="row">
002⫶ <div class="block-form {{ block_class }}">
003⫶ {{ ibexa_http_cache_tag_relation_location_ids(locationId) }}
004⫶        {{ render(controller('ibexa_content:viewAction', {
004⫶        {{ render(controller('ibexa_content::viewAction', {
005⫶            'contentId': contentId,
006⫶ 'locationId': locationId,
007⫶ 'viewType': 'embed'
008⫶ })) }}
009⫶ <style type="text/css">{{ block_style|raw }}</style>
010⫶ </div>
011⫶</div>

005⫶            'contentId': contentId,
006⫶ 'locationId': locationId,
007⫶ 'viewType': 'embed'
008⫶ })) }}
009⫶ <style type="text/css">{{ block_style|raw }}</style>
010⫶ </div>
011⫶</div>

Download colorized diff

Copy link
Contributor

@mnocon mnocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@adriendupuis adriendupuis merged commit bd703e1 into 5.0 Aug 12, 2025
7 of 8 checks passed
@adriendupuis adriendupuis deleted the fix-viewAction branch August 12, 2025 08:01
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.

2 participants