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.
Problem/Motivation
\Drupal\Core\Field\FieldStorageDefinitionInterface::isQueryable()
was originally introduced in #1696640-57: Implement API to unify entity properties and fields and moved around quite a bit since then, but it was never used and its purpose has since been replaced by \Drupal\Core\Field\FieldStorageDefinitionInterface::hasCustomStorage()
or \Drupal\Core\TypedData\DataDefinitionInterface::isComputed()
Proposed resolution
Deprecate \Drupal\Core\Field\FieldStorageDefinitionInterface::isQueryable()
and remove \Drupal\Core\Field\BaseFieldDefinition::setQueryable()
.
Remaining tasks
Review.
User interface changes
Nope.
API changes
Nope.
Data model changes
Nope.
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff-2855886-8-12.txt | 1.32 KB | himanshu-dixit |
#12 | 2855886-12.patch | 3.57 KB | himanshu-dixit |
#8 | interdiff-2855886-5-8.txt | 1.79 KB | shadcn |
#8 | deprecate-2855886-8.patch | 3.57 KB | shadcn |
#5 | interdiff-2855886-2-5.txt | 1.32 KB | shadcn |
Comments
Comment #2
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedSomething like this.
Comment #3
timmillwoodWhat if a contrib module is using
setQueryable()
? can we just remove it?Comment #4
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedThat's a good question.. we should probably deprecate instead of removing it.
Comment #5
shadcn CreditAttribution: shadcn at Chapter Three commentedDeprecated as per #4.
Comment #6
timmillwoodLooks good to me.
@amateescu, it'd be good if you could +1 #5 too.
Comment #7
alexpottYep this does not totally extraneous. We're in the process of putting together a policy on how to deprecate things. The basic bit is that we should add an
@trigger_error
.One of the things that is important is the trigger_error links to the change record for the deprecation - which this issue is missing.
Here's the current text for deprecating methods:
Add
@trigger_error('...', E_USER_DEPRECATED)
at the top of the method. Add@deprecated
to the docblock for the method. For example:Comment #8
shadcn CreditAttribution: shadcn at Chapter Three commentedThanks @alexpott. Here's a first draft: https://www.drupal.org/node/2856563
Comment #9
timmillwoodThanks @arshadcn, back to RTBC.
Comment #10
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedShouldn't we have the same message here? 8.4.0 vs. 8.4.x and the same for 9.0.0 and 9.0.x :)
Comment #11
xjmYep, they should end in .0 for clarity. 8.4.0 is a specific tag/tarball on a specific date. 8.4.x is a year's worth of ever-changing code in development and then stable. :)
For reference, the policy is live here now: https://www.drupal.org/core/deprecation
Comment #12
himanshu-dixit CreditAttribution: himanshu-dixit as a volunteer commentedHere is the new patch which updates the documentation
Comment #13
timmillwoodComment #15
catchCommitted/pushed to 8.4.x, thanks!
Comment #17
himanshu-dixit CreditAttribution: himanshu-dixit as a volunteer and at Google Summer of Code commentedAttributing the contribution to GSoC.