Skip to content

Update/Fix Product Catalog PHP API usage for 6.0 - #3481

Merged
adriendupuis merged 2 commits into
6.0from
fix-php
Nov 13, 2026
Merged

adriendupuis merged 2 commits into
6.0from
fix-php

Conversation

@adriendupuis

@adriendupuis adriendupuis commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor
Question Answer
JIRA Ticket
Versions
Edition

See #3476 for dependencies fix

ibexa/product-catalog #1588

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

@github-actions

Copy link
Copy Markdown

Preview of modified files: no change to preview.

@github-actions

Copy link
Copy Markdown

code_samples/ change report

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

code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Form/PercentValueFormMapper.php

docs/product_catalog/create_custom_attribute_type.md@30:``` php hl_lines="40"
docs/product_catalog/create_custom_attribute_type.md@31:[[= include_code('code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Form/PercentValueFormMapper.php') =]]
docs/product_catalog/create_custom_attribute_type.md@32:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Attribute\Percent\Form;
006⫶
007⫶use Ibexa\Bundle\ProductCatalog\Validator\Constraints\AttributeValue;
008⫶use Ibexa\Contracts\ProductCatalog\Local\Attribute\ValueFormMapperInterface;
009⫶use Ibexa\Contracts\ProductCatalog\Values\AttributeDefinitionAssignmentInterface;
010⫶use Symfony\Component\Form\Extension\Core\Type\PercentType;
011⫶use Symfony\Component\Form\FormBuilderInterface;
012⫶use Symfony\Component\Validator\Constraints as Assert;
013⫶
014⫶final class PercentValueFormMapper implements ValueFormMapperInterface
015⫶{
016⫶ public function createValueForm(
017⫶ string $name,
018⫶ FormBuilderInterface $builder,
019⫶ AttributeDefinitionAssignmentInterface $assignment,
020⫶ array $context = []
021⫶ ): void {
022⫶ $definition = $assignment->getAttributeDefinition();
023⫶
024⫶ $options = [
025⫶ 'disabled' => $context['translation_mode'] ?? false,
026⫶ 'label' => $definition->getName(),
027⫶ 'block_prefix' => 'percentage_attribute_value',
028⫶ 'required' => $assignment->isRequired(),
029⫶ 'constraints' => [

code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Form/PercentValueFormMapper.php

docs/product_catalog/create_custom_attribute_type.md@30:``` php hl_lines="40"
docs/product_catalog/create_custom_attribute_type.md@31:[[= include_code('code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Form/PercentValueFormMapper.php') =]]
docs/product_catalog/create_custom_attribute_type.md@32:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Attribute\Percent\Form;
006⫶
007⫶use Ibexa\Bundle\ProductCatalog\Validator\Constraints\AttributeValue;
008⫶use Ibexa\Contracts\ProductCatalog\Local\Attribute\ValueFormMapperInterface;
009⫶use Ibexa\Contracts\ProductCatalog\Values\AttributeDefinitionAssignmentInterface;
010⫶use Symfony\Component\Form\Extension\Core\Type\PercentType;
011⫶use Symfony\Component\Form\FormBuilderInterface;
012⫶use Symfony\Component\Validator\Constraints as Assert;
013⫶
014⫶final class PercentValueFormMapper implements ValueFormMapperInterface
015⫶{
016⫶ public function createValueForm(
017⫶ string $name,
018⫶ FormBuilderInterface $builder,
019⫶ AttributeDefinitionAssignmentInterface $assignment,
020⫶ array $context = []
021⫶ ): void {
022⫶ $definition = $assignment->getAttributeDefinition();
023⫶
024⫶ $options = [
025⫶ 'disabled' => $context['translation_mode'] ?? false,
026⫶ 'label' => $definition->getName(),
027⫶ 'block_prefix' => 'percentage_attribute_value',
028⫶ 'required' => $assignment->isRequired(),
029⫶ 'constraints' => [
030⫶                new AttributeValue([
031⫶ 'definition' => $definition,
032⫶ ]),
033⫶ ],
034⫶ ];
035⫶
036⫶ if ($assignment->isRequired()) {
037⫶ $options['constraints'][] = new Assert\NotBlank();
038⫶ }
039⫶
040❇️ $builder->add($name, PercentType::class, $options);
041⫶ }
042⫶}
030⫶                new AttributeValue($definition),
031⫶ ],
032⫶ ];
033⫶
034⫶ if ($assignment->isRequired()) {
035⫶ $options['constraints'][] = new Assert\NotBlank();
036⫶ }
037⫶
038⫶ $builder->add($name, PercentType::class, $options);
039⫶ }
040❇️}


code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsFormMapper.php

docs/product_catalog/create_custom_attribute_type.md@77:``` php
docs/product_catalog/create_custom_attribute_type.md@78:[[= include_code('code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsFormMapper.php') =]]
docs/product_catalog/create_custom_attribute_type.md@79:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Attribute\Percent;
006⫶
007⫶use Ibexa\Bundle\ProductCatalog\Validator\Constraints\AttributeDefinitionOptions;
008⫶use Ibexa\Contracts\ProductCatalog\Local\Attribute\OptionsFormMapperInterface;
009⫶use Symfony\Component\Form\FormBuilderInterface;
010⫶
011⫶final class PercentOptionsFormMapper implements OptionsFormMapperInterface
012⫶{
013⫶ public function createOptionsForm(string $name, FormBuilderInterface $builder, array $context = []): void
014⫶ {
015⫶ $builder->add($name, PercentAttributeOptionsType::class, [
016⫶ 'constraints' => [


code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsFormMapper.php

docs/product_catalog/create_custom_attribute_type.md@77:``` php
docs/product_catalog/create_custom_attribute_type.md@78:[[= include_code('code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsFormMapper.php') =]]
docs/product_catalog/create_custom_attribute_type.md@79:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Attribute\Percent;
006⫶
007⫶use Ibexa\Bundle\ProductCatalog\Validator\Constraints\AttributeDefinitionOptions;
008⫶use Ibexa\Contracts\ProductCatalog\Local\Attribute\OptionsFormMapperInterface;
009⫶use Symfony\Component\Form\FormBuilderInterface;
010⫶
011⫶final class PercentOptionsFormMapper implements OptionsFormMapperInterface
012⫶{
013⫶ public function createOptionsForm(string $name, FormBuilderInterface $builder, array $context = []): void
014⫶ {
015⫶ $builder->add($name, PercentAttributeOptionsType::class, [
016⫶ 'constraints' => [
017⫶                new AttributeDefinitionOptions(['type' => $context['type']]),
017⫶                new AttributeDefinitionOptions($context['type']),
018⫶            ],
019⫶ 'translation_mode' => $context['translation_mode'],
020⫶ ]);
021⫶ }
022⫶}

018⫶            ],
019⫶ 'translation_mode' => $context['translation_mode'],
020⫶ ]);
021⫶ }
022⫶}

Download colorized diff

@adriendupuis adriendupuis changed the title Update/Fix PHP API usage for 6.0 Update/Fix Product Catalog PHP API usage for 6.0 Nov 13, 2026
@adriendupuis
adriendupuis marked this pull request as ready for review November 13, 2026 13:56
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Summary

Status Count
🔍 Total 755351
🔗 Unique 15274
✅ Successful 6412
⏳ Timeouts 0
🔀 Redirected 6
👻 Excluded 748931
❓ Unknown 0
🚫 Errors 8
⛔ Unsupported 0

Errors per input

Errors in site/getting_started/requirements/index.html

Errors in site/ibexa_products/ibexa_commerce/index.html

Errors in site/ibexa_products/ibexa_experience/index.html

Errors in site/ibexa_products/ibexa_headless/index.html

Errors in site/multisite/translations_management/configure_translations_management/index.html

  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/content_management/translate_content/index.html#add-new-translation (at 14694:25) | Cannot find fragment

Errors in site/multisite/translations_management/translate_with_cli/index.html

  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/content_management/translate_content/index.html#add-new-translation (at 14312:112) | Cannot find fragment

Errors in site/recommendations/raptor_integration/connector_installation_configuration/index.html

Errors in site/release_notes/ibexa_dxp_v4.4/index.html

Redirects per input

Redirects in site/getting_started/requirements/index.html

Redirects in site/ibexa_products/ibexa_commerce/index.html

Redirects in site/ibexa_products/ibexa_experience/index.html

Redirects in site/ibexa_products/ibexa_headless/index.html

Redirects in site/recommendations/raptor_integration/connector_installation_configuration/index.html

Redirects in site/release_notes/ibexa_dxp_v4.4/index.html

Full Github Actions output

@adriendupuis
adriendupuis merged commit b183aae into 6.0 Nov 13, 2026
7 of 11 checks passed
@adriendupuis
adriendupuis deleted the fix-php branch November 13, 2026 13:57
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