Contact message "uid" field has target_type "contact_form"

Created on 9 July 2020, almost 4 years ago
Updated 22 June 2024, 6 days ago

In contact_storage_entity_base_field_info, the code defines the uid field but sets the target type to "contact_form". This makes it impossible to create a contact message with a non-anonymous user with jsonapi.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • First commit to issue fork.
  • Status changed to Needs review about 1 month ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    If the schema has already been broken, do we need to migrate any data? It never would have worked to begin with?

    MR up with a straight uninstall + reinstall update hook.

  • Merge request !13Change uid field to user entity type β†’ (Open) created by acbramley
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 month ago
    8 pass
  • Pipeline finished with Failed
    about 1 month ago
    Total: 246s
    #172911
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 month ago
    8 pass
  • Pipeline finished with Failed
    about 1 month ago
    Total: 228s
    #173014
  • Status changed to Needs work about 1 month ago
  • Status changed to Needs review about 1 month ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Was that an accident @andypost?

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 month ago
    8 pass
  • Pipeline finished with Failed
    about 1 month ago
    Total: 396s
    #173807
  • πŸ‡«πŸ‡·France andypost

    No, for reason of tests

    There was 1 error:
    1) Drupal\Tests\contact_storage\Functional\ContactStorageTest::testContactStorage
    Behat\Mink\Exception\ElementNotFoundException: Form field with id|name|label|value "field_storage[subform][settings][allowed_values]" not found.
    /builds/issue/contact_storage-3158051/vendor/behat/mink/src/WebAssert.php:731
    /builds/issue/contact_storage-3158051/web/core/tests/Drupal/Tests/UiHelperTrait.php:85
    /builds/issue/contact_storage-3158051/web/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php:105
    /builds/issue/contact_storage-3158051/tests/src/Functional/ContactStorageTest.php:218
    /builds/issue/contact_storage-3158051/vendor/phpunit/phpunit/src/Framework/TestResult.php:729
    ERRORS!
    Tests: 8, Assertions: 229, Errors: 1.
  • Status changed to Needs work about 1 month ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    @andypost thats only in gitlab CI, which is also failing on HEAD. I was trying to get some quick fixes through but obviously it needs more work so I will split that stuff into a separate issue.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 month ago
    8 pass
  • Status changed to Needs review about 1 month ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    πŸ› t() calls should be avoided in classes RTBC contains the t() fixes.

  • πŸ‡¨πŸ‡­Switzerland Berdir Switzerland

    > If the schema has already been broken, do we need to migrate any data? It never would have worked to begin with?

    But it has worked, the field has a default value callback, so it is storing data. It just happens to be storing the user ids as strings. There are aspects that wouldn't work, like doing a join on that field on PostgreSQL, but storing would work there too.

    Unsure what to do about this, for most sites that field won't matter, but there absolutely might be use cases that rely on the uid and this will delete their data.

Production build 0.69.0 2024