- Issue created by @luca.pecchiura
- πΊπΈUnited States danflanagan8 St. Louis, US
I wonder if this has anything to do with recent changes to how field type categories work. See this change record: [#3375748].
What happens if you hack the viewfield module and change the field type category from
@Translation('Reference')
to"reference"
?Here's the line: https://git.drupalcode.org/project/viewfield/-/blob/8.x-3.x/src/Plugin/F...
- πΊπΈUnited States danflanagan8 St. Louis, US
I did a quick search for that same error and have found some related issues:
π TypeError: Cannot access offset of type Drupal\Core\StringTranslation\TranslatableMarkup in isset or empty in Active
π Changes in site building process can run into Cannot access offset of type StringTranslation\TranslatableMarkup on field creation path Active
π Site crush when creating new fields Active
π FieldItemBase category cannot be translatable ActiveI haven't looked closely, but the last one in particular seemed to be looking at the field type category as I had suspected.
- πΊπΈUnited States danflanagan8 St. Louis, US
I was wondering why the viewfield tests don't fail on D11. I think it's because this bug is only triggered when using field UI to add a field. In the tests, the fields are created programmatically. But then why do the same tests pass on D10? Shouldn't there be some kind of deprecation notice that pops up in D10? Or shouldn't there have been a rector rule for this change? This looks like a change we should have handled better as a community.
- πΊπΈUnited States danflanagan8 St. Louis, US
Huh, when I run the test suite locally on D10.3 I indeed get these deprecation notices:
Remaining self deprecation notices (16)
9x: Using a translatable string as a category for field type is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3375748 β
1x in ViewfieldFormatterTest::testViewfieldFormatterDefault from Drupal\Tests\viewfield\FunctionalJavascript
1x in ViewfieldFormatterTest::testViewfieldFormatterTitle from Drupal\Tests\viewfield\FunctionalJavascript
1x in ViewfieldFormatterTest::testViewfieldFormatterRendered from Drupal\Tests\viewfield\FunctionalJavascript
1x in ViewfieldFormatterTest::testViewfieldArgumentHandling from Drupal\Tests\viewfield\FunctionalJavascript
1x in ViewfieldFormatterTest::testViewfieldItemsToDisplay from Drupal\Tests\viewfield\FunctionalJavascriptwhy don't I see those in Gitlab?
- πΊπΈUnited States danflanagan8 St. Louis, US
There was never a rector rule for this, AFAICT. I found a discussion in Slack, but I don't see anything in the rector issue queue.
https://drupal.slack.com/archives/C03L6441E1W/p1716293607661759
- πΊπΈUnited States danflanagan8 St. Louis, US
I put in an MR. I made the category "viewfield" so that it doesn't get buried in the "reference" category.
- πΊπΈUnited States danflanagan8 St. Louis, US
Ah dammit. I committed to the repo and not the issue fork. I reverted it. Trying again on the fork.
-
danflanagan8 β
committed f929ee53 on 8.x-3.x
Issue #3488894 by danflanagan8, luca.pecchiura: Viewfield causes error...
-
danflanagan8 β
committed f929ee53 on 8.x-3.x
- πΊπΈUnited States danflanagan8 St. Louis, US
I tested this and it works. I'm just going to merge and do a release.
Automatically closed - issue fixed for 2 weeks with no activity.