Closed (won't fix)
Project:
Features
Version:
8.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2016 at 16:39 UTC
Updated:
1 Sep 2016 at 17:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
grimreaperHere is the patch.
Thanks for the review.
Comment #3
grimreaperI have found other places where ->render() is required to avoid the warning.
Comment #4
nedjoLooks right to me.
Comment #6
mpotter commentedCommitted to ceb2f3f.
Comment #7
grimreaperThanks!
Comment #9
mpotter commentedActually, needed to revert this patch because it caused the error in #2745287: Features UI Error: Call to a member function render() on string in Drupal\features\FeaturesManager. Also, when this patch is applied, expanding the details of the features in the main listing page shows empty component categories.
Certainly the addition of ->render() to the EntityTypeInterface->getLabel in FeaturesManager is incorrect because looking at the documentation for that, getLabel returns a string not a render array.
It's possible there were core changes since the original patch was created.
Comment #10
grimreaperHello,
Here is a new patch that should fix the issue and the fatal error.
On a Drupal 8.1.x (after 8.1.3) from git, and features on 8.3.x with git I still have the issue and the patch fix it.
The original patch was made against Drupal 8.0.x (I don't remember the exact version).
I think the problem comes from a config entity that does not declare properly its label because I don't have the problem. I am curious to know for which entity the fatal error was triggered on #2745287: Features UI Error: Call to a member function render() on string in Drupal\features\FeaturesManager. Also you mention empty component categories for which categories is the label empty?
Yes the documentation says that "->getLabel()" returns a string but when inspecting for debug it is a TranslatableMarkup that is returned so I don't know what to follow.
Comment #11
grimreaperHello,
I am currently testing varnish_purge and I am finally able to reproduce the fatal error as I was applying my first patch.
The problem comes from config entity types not declaring label.
As you can see on http://cgit.drupalcode.org/varnish_purge/tree/src/Entity/VarnishPurgerSe..., in the @ConfigEntityType annotation there is
(I will make a patch on varnish_purge for that)
And on the admin/config/development/configuration/single/export, in the select list "Configuration type", there is an empty option.
Comment #12
mpotter commentedI'm not seeing this error. You need to test in the latest release of Drupal core, so I cannot fix something from the old 8.1.3. You need to use 8.1.8 as of this writing. If getLabel is returning an object instead of string then that should be investigated as a core or contrib bug since that violates the interface definition. This isn't something to fix in Features. Adding a bunch of ::render() calls is not good practice.