Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
8 Feb 2019 at 06:49 UTC
Updated:
1 Apr 2019 at 19:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
akshay_ddeprecated methods removed, please review
Comment #3
akshay_dComment #5
akshay_dupdated deprecated method
Comment #7
joelpittetThere is a failure in the code but here's one hint:
This is getting the form display not the view display?
Thanks for trying to fix these!
Comment #8
bhanuprakashnani commentedComment #9
bhanuprakashnani commentedI have changed the getViewDisplay to getFormDisplay as the function entity_get_form_display is form-display function, not a view display one. Please review and let me know whether my step was correct or not. Would like to work on this issue if anything more required thank you.
Comment #11
joelpittetThank you again, the failed tests will need to be resolved before I can commit this
Comment #12
bhanuprakashnani commentedSorry for the mistake. I forgot to include the EntityTypeManagerManager
Comment #14
bhanuprakashnani commentedAdded the entityformdisplayinterface.
Comment #16
bhanuprakashnani commentedI am not able to get why am I getting errors when I have include
use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
use Drupal\Core\Entity\EntityTypeManagerManager;
It is throwin an error that an undefined function is being called. But the functions getFormDisplay and getViewDisplay are valid right. Can some one please tell me where am i going wrong. Thank you.
Comment #17
andrtroe commentedComment #18
andrtroe commentedComment #20
andrtroe commentedComment #22
bkhandruk commentedHi!
This should work.
Comment #23
andrtroe commentedYes this way it will work, but I thought it should be already created somewhere before.
Comment #24
bkhandruk commented@andrey.troeglazov
View/form configuration is not created by default for each entity type and bundle where view/form mode is available.
That's why we have this check and we create one if nothing is loaded.
Also the logs from testing patch #20 are pretty clear about the reason why it's failed.
https://www.drupal.org/pift-ci-job/1196548
Comment #25
andrtroe commentedYes I know, I mean entity_get_form_display tries to load display and if can't it creates a new one.
Now I see that EntityFormDisplay::load() only loads it and not creating. Thank you. RTBC from me.
Comment #26
andrtroe commented/summon @joelpittet :)
Comment #27
joelpittetI'm looking at the creation like mentioned in #23, that doesn't seem the right place to create those, if the creation needs to happen it should happen before so we know the state going into the test, so in setUp() or elsewhere and not conditional.
Comment #28
joelpittetThis should work because it's expecting the result to assert isNew() == TRUE on the $display.
Comment #29
joelpittetI see where you're coming from @rocket.man on the patch so thank you for doing that! The test assertion is not needed if we know we're creating it but I think it's fine to have expectations that if we create it because it's not there then that should be enough for the test. (sorry hope that make sense, explaining is a bit fuzzy at the moment)
Comment #31
joelpittetI wonder why this started failing in 8.7 recently but I've committed it to the dev branch. Thanks for all your help!