You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ composer show --latest 'sonata-project/*'
Direct dependencies required in composer.json:
sonata-project/entity-audit-bundle 1.18.0 1.18.0 Audit for Doctrine Entities
Transitive dependencies not required in composer.json:
Everything up to date
Symfony packages
show
$ composer show --latest 'symfony/*'
Direct dependencies required in composer.json:
symfony/apache-pack v1.0.1 v1.0.1 A pack for Apache support in Symfony
symfony/asset v6.4.8 v7.1.1 Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files
symfony/cache v6.4.8 v7.1.5 Provides extended PSR-6, PSR-16 (and tags) implementations
symfony/console v6.4.8 v7.1.5 Eases the creation of beautiful and testable command line interfaces
symfony/doctrine-bridge v6.4.8 v7.1.5 Provides integration for Doctrine with various Symfony components
symfony/dotenv v6.4.8 v7.1.5 Registers environment variables from a .env file
symfony/expression-language v6.4.8 v7.1.4 Provides an engine that can compile and evaluate expressions
symfony/flex v2.4.5 v2.4.7 Composer plugin for Symfony
symfony/framework-bundle v6.4.8 v7.1.5 Provides a tight integration between Symfony components and the Symfony full-stack framework
symfony/http-foundation v6.4.8 v7.1.5 Defines an object-oriented layer for the HTTP specification
symfony/mailer v6.4.8 v7.1.5 Helps sending emails
symfony/maker-bundle v1.59.1 v1.61.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writi...
symfony/mime v6.4.8 v7.1.5 Allows manipulating MIME messages
symfony/monolog-bundle v3.10.0 v3.10.0 Symfony MonologBundle
symfony/runtime v6.4.8 v7.1.1 Enables decoupling PHP applications from global state
symfony/security-bundle v6.4.8 v7.1.4 Provides a tight integration of the Security component into the Symfony full-stack framework
symfony/serializer v6.4.8 v7.1.5 Handles serializing and deserializing data structures, including object graphs, into array structures or other formats...
symfony/twig-bundle v6.4.8 v7.1.5 Provides a tight integration of Twig into the Symfony full-stack framework
symfony/validator v6.4.8 v7.1.5 Provides tools to validate values
symfony/yaml v6.4.8 v7.1.5 Loads and dumps YAML files
Transitive dependencies not required in composer.json:
symfony/cache-contracts v3.5.0 v3.5.0 Generic abstractions related to caching
symfony/clock v6.4.8 v7.1.1 Decouples applications from the system clock
symfony/config v6.4.8 v7.1.1 Helps you find, load, combine, autofill and validate configuration values of any kind
symfony/css-selector v6.4.8 v7.1.1 Converts CSS selectors to XPath expressions
symfony/dependency-injection v6.4.8 v7.1.5 Allows you to standardize and centralize the way objects are constructed in your application
symfony/deprecation-contracts v3.5.0 v3.5.0 A generic function and convention to trigger deprecation notices
symfony/error-handler v6.4.8 v7.1.3 Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher v6.4.8 v7.1.1 Provides tools that allow your application components to communicate with each other by dispatching events and listeni...
symfony/event-dispatcher-contracts v3.5.0 v3.5.0 Generic abstractions related to dispatching event
symfony/filesystem v6.4.8 v7.1.5 Provides basic utilities for the filesystem
symfony/finder v6.4.8 v7.1.4 Finds files and directories via an intuitive fluent interface
symfony/http-kernel v6.4.8 v7.1.5 Provides a structured process for converting a Request into a Response
symfony/monolog-bridge v6.4.8 v7.1.1 Provides integration for Monolog with various Symfony components
symfony/options-resolver v6.4.8 v7.1.1 Provides an improved replacement for the array_replace PHP function
symfony/password-hasher v6.4.8 v7.1.1 Provides password hashing utilities
symfony/polyfill-intl-grapheme v1.30.0 v1.31.0 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-idn v1.31.0 v1.31.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer v1.30.0 v1.31.0 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring v1.30.0 v1.31.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php83 v1.30.0 v1.31.0 Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions
symfony/process v6.4.8 v7.1.5 Executes commands in sub-processes
symfony/property-access v6.4.8 v7.1.4 Provides functions to read and write from/to an object or array using a simple string notation
symfony/property-info v6.4.8 v7.1.3 Extracts information about PHP class' properties using metadata of popular sources
symfony/routing v6.4.8 v7.1.4 Maps an HTTP request to a set of configuration variables
symfony/security-core v6.4.8 v7.1.5 Symfony Security Component - Core Library
symfony/security-csrf v6.4.8 v7.1.1 Symfony Security Component - CSRF Library
symfony/security-http v6.4.8 v7.1.5 Symfony Security Component - HTTP Integration
symfony/service-contracts v3.5.0 v3.5.0 Generic abstractions related to writing services
symfony/stopwatch v6.4.8 v7.1.1 Provides a way to profile code
symfony/string v6.4.8 v7.1.5 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/translation-contracts v3.5.0 v3.5.0 Generic abstractions related to translation
symfony/twig-bridge v6.4.8 v7.1.5 Provides integration for Twig with various Symfony components
symfony/var-dumper v6.4.8 v7.1.5 Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter v6.4.8 v7.1.2 Allows exporting any serializable PHP data structure to plain PHP code
PHP version
$ php -v
PHP 8.2.21 (cli) (built: Jul 6 2024 01:41:16) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.21, Copyright (c) Zend Technologies
with Zend OPcache v8.2.21, Copyright (c), by Zend Technologies
with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans
Subject
We are using this bundle to save historical updates of some entities inside our symfony project and in our flow we need to create a relationship between our entity Operation and another entity Shop audit table.
To do that we first create an entity ShopAudit that contains the exact mapping of the _audit table created by the library, and then we setup the relationship on the Operation entity using the ShopAudit entity as targetEntity and a multiple join column, so now the Operation entity contains a composite foreign key done using the id,rev columns from the _audit table.
We also map the revisions table from the library in a Revision entity class, and excluded all entities mapped manually (ShopAudit, Revision) from doctrine migrations.
When we try to persist or update the Operation entity and call the flush() method from the entity manager the library tries to create an audit record but breaks with an ErrorException and the message Warning: Undefined array key "rev".
With the configuration above, just for debug purpose we also tried to comment out Operation entity from the audited_entities config and the entity was persisted without any errors but without an audit record.
Does the library supports auditing entities that contain a composite foreign key or requires some updates to handle that?
Environment
Sonata packages
show
Symfony packages
show
PHP version
Subject
We are using this bundle to save historical updates of some entities inside our symfony project and in our flow we need to create a relationship between our entity
Operation
and another entityShop
audit table.To do that we first create an entity
ShopAudit
that contains the exact mapping of the _audit table created by the library, and then we setup the relationship on the Operation entity using the ShopAudit entity as targetEntity and a multiple join column, so now the Operation entity contains a composite foreign key done using theid,rev
columns from the _audit table.We also map the
revisions
table from the library in aRevision
entity class, and excluded all entities mapped manually (ShopAudit, Revision) from doctrine migrations.When we try to persist or update the Operation entity and call the
flush()
method from the entity manager the library tries to create an audit record but breaks with an ErrorException and the messageWarning: Undefined array key "rev"
.With the configuration above, just for debug purpose we also tried to comment out Operation entity from the audited_entities config and the entity was persisted without any errors but without an audit record.
Does the library supports auditing entities that contain a composite foreign key or requires some updates to handle that?
Entities definition
App\Entity\Operation
App\Entity\ShopAudit
App\Entity\Revision
Steps to reproduce
composer require sonata-project/entity-audit-bundle
orm.schema_ignore_classes
doctrine configurationphp bin/console make:migration
php bin/console do:mi:mi
Expected results
Audit entities that also contains composite foreign keys defined using multiple doctrine JoinColumn.
Actual results
Exception dump
Trace
The text was updated successfully, but these errors were encountered: