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.
API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...
> array|bool The table field mapping for the given table or FALSE if not available.
That leads you to believe that the return is the same as what you get from $storage->getTableMapping()->getAllColumns($table). But it's not -- the array is flipped, so keys are field names and values are just incrementing integers.
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff_4-7.txt | 680 bytes | leolandotan |
#7 | fix-return-doc-2975751-7.patch | 899 bytes | leolandotan |
#4 | fix-return-doc-2975751-4.patch | 845 bytes | msankhala |
#2 | fix-return-doc-2975751-2.patch | 813 bytes | msankhala |
Comments
Comment #2
msankhala CreditAttribution: msankhala as a volunteer and at Srijan | A Material+ Company commentedHere is a patch.
Comment #3
joachim CreditAttribution: joachim as a volunteer commentedThe 'or FALSE' sounds like it's an alternative to the incrementing integer, rather than the whole thing.
I would make a new sentence here:
> incrementing integers. If the (table? mapping? it's not clear WHAT is not available) is not available, FALSE is returned.
Comment #4
msankhala CreditAttribution: msankhala as a volunteer and at Srijan | A Material+ Company commented@joachim Here is updated patch. Tables::getTableMapping() simply checks if
$storage instanceof SqlEntityStorageInterface
and gets the table mapping so it is never clear whether table is not available or mapping is not available.Comment #5
claudiu.cristeaSo, it's array OR false. Then let's be more explicit:
@return array|false
PS: Please post an interdiff each time, regardless of how small is the change.
Comment #6
leolandotan CreditAttribution: leolandotan as a volunteer and at Promet Source commentedI'll work on this.
Comment #7
leolandotan CreditAttribution: leolandotan as a volunteer and at Promet Source commentedI applied the required fix from comment #5.
Hope everything is in order.
Comment #8
claudiu.cristeaThank you!
Comment #9
alexpottCommitted and pushed 845da7492b to 8.6.x and aaf49c1413 to 8.5.x. Thanks!