Skip to content

Conversation

@mnocon
Copy link
Contributor

@mnocon mnocon commented Aug 20, 2024

Target: master, 4.6

The Custom Attribute type example is using the Ibexa\ProductCatalog\Local\Persistence\Legacy\Attribute\Boolean\StorageSchema class, but it's confusing - it should be using the Ibexa\ProductCatalog\Local\Persistence\Legacy\Attribute\Float\StorageSchema class.

Reasoning:

  1. The PercentStorageDefinition is using Float (https://github.com/ibexa/documentation-developer/blob/master/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageDefinition.php#L13) so it makes it consistent
  2. The value type is float (https://github.com/ibexa/documentation-developer/blob/master/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageDefinition.php#L20) and boolean looks out of context here.

It works by accident (because Ibexa\ProductCatalog\Local\Persistence\Legacy\Attribute\Boolean\StorageSchema::COLUMN_VALUE and Ibexa\ProductCatalog\Local\Persistence\Legacy\Attribute\Float\StorageSchema::COLUMN_VALUE have the same value - value), but it's better to make it consistent.

See:

Preview:
https://ez-systems-developer-documentation--2474.com.readthedocs.build/en/2474/pim/create_custom_attribute_type/#storage-converter

@mnocon mnocon marked this pull request as ready for review August 21, 2024 07:08
@mnocon mnocon requested a review from a team August 21, 2024 07:08
@konradoboza konradoboza requested a review from a team August 27, 2024 07:03
@Steveb-p Steveb-p requested a review from a team August 27, 2024 07:40
@mnocon mnocon merged commit b4ee9a5 into master Aug 27, 2024
@mnocon mnocon deleted the custom-attribute branch August 27, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants