Needs work
Project:
Computed Field
Version:
3.0.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
3 Aug 2025 at 22:51 UTC
Updated:
25 Jun 2026 at 20:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
cemproduction commentedI'm using v3 on Drupal 11.
So far, there was one issue related to :
New API for defining field type categories - Setting the field type category as a translatable label in annotation is deprecated
I solved it for now by removing "@Translation" from the field type category in the FieldType plugins definitions.
Comment #3
aslaymoore commentedComment #5
aslaymoore commentedI've added a merge request that adds D11 to the info file of the 3.x module, and tested it against the site we're in the process of upgrading to D11. Would be good to test it against other sites upgrading to D11 that also need to stay on the 3.x branch.
Comment #6
aslaymoore commentedHere's a patch file for the merge request on #4.
Comment #7
aslaymoore commentedComment #9
richyu commentedA patch that removes "category" from the FieldType plugins definitions.
Comment #10
joachim commentedThere's already a MR - what's the patch for?
Comment #11
hilly510 commentedWe need to add a composer.json to the MR in order to fully support D11. Can someone do that or add me to the repo so I can add it?
Comment #12
joachim commentedI've not heard anything about that. Do you have a link to docs about it?
Comment #13
hilly510 commentedIt seems like it shouldn't be required, but I just tried to upgrade to Drupal 11 using this MR (23) and composer ended in an error complaining about this module not including a composer.json file.
Here is the doc about it https://www.drupal.org/docs/develop/using-composer/add-a-composerjson-file
Comment #14
joachim commented> If a module does not have any dependencies, or the dependencies are solely other Drupal modules, then a composer.json is not required. However, having a composer.json does not have a negative impact either.
Comment #15
baikho commented#9
Removing is not a good solution, and without dropping older core compatibility the BC layer needs adding https://www.drupal.org/node/3375748#bc
Comment #17
kenwest commentedI've added a fix for the issue with using @Translation() on a @FieldType's category setting. I borrowed the logic from a similar fix made to the Entity Reference Display module. A quick survey of the modules I'm using indicated a 50:50 split between the category being lower cased or proper cased, so I selected "Computed" rather than "computed" as this seemed like the path of least harm.
This approach addresses @baikho's concerns in #15.
Comment #18
junaidpvCurrent MR23 in patch form to use in composer based build.
Comment #19
akshay kashyap commentedComment #20
akshay kashyap commentedI tested Merge Request !23 (and the corresponding patch from #17/#18) on a Drupal 10 site running Computed Field 3.x and upgraded the site successfully to Drupal 11.
What I tested:
Installed the patch on Computed Field 3.0.x.
Upgraded Drupal core from 10.5 to 11.3.x.
Verified that existing computed fields still function as expected and recalculate values correctly.
Checked the logs for any @Translation annotation deprecation warnings related to FieldType categories—none were found.
The patch correctly addresses the backward-compatibility concerns raised in #15 by keeping a clean string category (category = "Computed"), which Drupal 10.2+ and Drupal 11 handle seamlessly.
This works perfectly and resolves the upgrade blocker for sites stuck on v3. Ready to commit!
Comment #21
joachim commentedWas #20 written with an LLM? It reads a lot like LLM output.
Comment #22
hoporr commentedI installed MR 23, tested it, it seems to work fine:
1) First with the older 10.6 install, and it worked.
2) I then did the upgrade to Drupal 11.3.11, and it seems to also work fine: when I edit and save a content-type, the field updates correctly.
( I used composer lenient to get around the fact that the patch applies after the core install, otherwise there was a version conflict. )
My two cents:
I really think having 3.0 at least initially running in D11 is important, because 1) it does not block the upgrade to D11, and 2) that way the data in the fields (in the DB) stays in the system until I have the new solution in place. Without this, I would have to uninstall computed_fields before the upgrade, and thus would loose all the data, and it would force me to somehow port all this in a pre-step before the update... Given that I now have the data in D11, I can write a hook_n_update or whatnot and port the data over into new fields, etc.
Comment #23
joachim commentedIf you've reviewed the MR and you think it's fine, please feel free to mark it RTBC and then I'll commit it.
Comment #24
hoporr commentedComment #26
joachim commentedThanks.
Making a new patch release as per https://www.drupal.org/docs/develop/managing-a-drupalorg-theme-module-or...
Thanks everyone!
Comment #28
marcellinostroosnijder commentedI have also tested MR 23 on 11.3.10, but I received the following error:
Looking through the comments in this thread and the MR, nothing has been done about comment #15. Should we not look into this. For me, the patch from #9 works - but is not ideal.
Can someone look into this before the module is marked as Drupal 11 ready?
Comment #29
joachim commentedI already committed the MR and made a release. Please start a new issue for this.