Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The file_usage table specifies the length of entity ids (id column) as 64 chars.
However, we're building a semantic web application where our entity storage backend uses a triple store database (Virtuoso) to store our entities as RDF. This implies that our entity ids are in fact URIs.
Although this probably is quite an exotic edge case, most probably there are other use cases (https://www.drupal.org/project/external_entities) where 64 chars is too limited.
Comment | File | Size | Author |
---|---|---|---|
#30 | interdiff.txt | 585 bytes | pfrenssen |
#30 | 2675600-30.patch | 6.32 KB | pfrenssen |
#17 | 2675600-17-test-only.patch | 4.51 KB | pfrenssen |
#17 | 2675600-17.patch | 6.19 KB | pfrenssen |
Comments
Comment #2
sandervd CreditAttribution: sandervd commentedComment #3
pfrenssenComment #4
pfrenssenIndeed core supports entity IDs up to 255 characters so this should be updated as such.
This still needs a test. The easiest way of testing this is to use the EntityTestStringId entity and add a file field to it.
db_change_field()
is deprecated. You can use\Drupal::database()->schema()->changeField()
instead. Seesystem_update_8001()
for an example.Comment #5
pfrenssenI fixed my remarks and added a test. By increasing the ID length to 255 characters (which is allowed for entities) it transpires that there is another bug preventing this from working: SqlContentEntityStorageSchema imposes a hard limit of 128 characters for the
entity_id
in the field tables. I will create a separate issue for this.This at least proof that the fix works. It needs another test for the update path.
Comment #8
pfrenssenThe change to SqlContentEntityStorageSchema caused their test to fail. Addressed that and created a separate issue for it: #2676606: Entities with a string ID longer than 128 characters cannot be referenced by fields.
Comment #12
claudiu.cristeaComment #13
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation commentedComment #14
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation commentedReroll of #8.
Comment #17
pfrenssenUpdated patch with some small coding standards fixes. Setting to "Needs review" for the bot but this is still postponed on #2676606: Entities with a string ID longer than 128 characters cannot be referenced by fields.
Comment #19
claudiu.cristeaReroll.
Comment #20
claudiu.cristeaIncrease to 2048
Comment #22
pfrenssenRerolled #19 against latest HEAD, there was a merge conflict since #2801777: Give users the option to prevent drupal from automatically marking unused files as temporary got in.
Comment #25
pfrenssenHere is a version that should apply to 8.3.x.
Comment #27
pfrenssenFixy fixy.
Comment #30
pfrenssenFixy fixy?
Comment #31
pfrenssenCool we're green again, postponing on #2676606: Entities with a string ID longer than 128 characters cannot be referenced by fields.