Needs work
Project:
Drupal core
Version:
main
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Jul 2019 at 16:01 UTC
Updated:
17 Aug 2024 at 14:15 UTC
Jump to comment: Most recent
Comments
Comment #3
longwaveThis can be considered now, but it looks like CiviCRM calls both these methods, so we might have to fully deprecate this somehow?
http://grep.xnddx.ru/search?text=setFieldNames&filename=
Comment #4
xjmSince 8.9.x and 9.0.x are now in beta, the way to do this would be to trigger a deprecation warning when the method is called from outside the class(es). We'd add that in a minor release of Drupal 9, and then that BC layer would be removed as part of the deprecation cleanup in Drupal 10. Thanks!
Comment #10
bhanu951 commentedSeems this issue has passed 10.x release as well, we need to plan it for 11.x release.
Comment #12
tstoecklerJust stumbled upon this. Currently there is not really an easy way to modify the default table mapping, in my opinion. Unless you actually want something radically different providing a different (sub-)class other than
DefaultTableMapping, while possible, is not actually very helpful, because you may need to copy the entire class just to change a few lines. Having these methods public, currently allows avoiding that and actually making small alterations with just a small amount of code. See #3310170: Use UUID as entity ID for something that is currently fixable fairly cleanly from custom code which would become impossible, not in principle, but in reality, if these methods were made protected.Since this also does not bring any maintainability gain as far as I can tell, I am against this until we have a different more bespoke API for actually customizing the entity table layout.
Comment #13
tstoecklerComment #16
arunkumarkThe methods
setFieldNames()andsetExtraColumns()are called inside the class only. So, it can be converted into the protected.There is another conversion of renaming
setFieldNamesthe function on issue #3458145: Replace DefaultTableMapping::setFieldNames() with ::add*() and ::remove*(). If the approach is taken place we have to reroll this patch by making a protected method.Comment #17
tstoecklerRe #16: As I noted in #12 these methods are helpful for contrib/custom code, so I don't think your argument is very convincing
Comment #18
smustgrave commentedFor more discussion.
Also don't believe we can change this in a minor so if we still decide to update we can't do until D12