Contact message "uid" field has target_type "contact_form"

Created on 9 July 2020, over 4 years ago
Updated 21 August 2024, 5 months 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 8 months 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 8 months ago
    8 pass
  • Pipeline finished with Failed
    8 months ago
    Total: 246s
    #172911
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 8 months ago
    8 pass
  • Pipeline finished with Failed
    8 months ago
    Total: 228s
    #173014
  • Status changed to Needs work 8 months ago
  • Status changed to Needs review 8 months 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 8 months ago
    8 pass
  • Pipeline finished with Failed
    8 months 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 8 months 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 8 months ago
    8 pass
  • Status changed to Needs review 8 months 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.

  • First commit to issue fork.
  • Pipeline finished with Success
    5 months ago
    Total: 442s
    #260822
  • 🇦🇺Australia mstrelan

    Rebased for 8.x-1.4, only conflict was the use statements in contact_storage.install

Production build 0.71.5 2024