Closed (fixed)
Project:
Entity Reference Revisions
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Mar 2016 at 13:32 UTC
Updated:
9 May 2016 at 16:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
miro_dietikerI do prefer to commit deprecated and other non-functional clean-up fixes as a combined patch.
We should preferrably work through all the positive reports at "PHPStorm Code - Inspect Code" in this issue.
Comment #3
johnchqueComment #4
shiva srikanth t commented@miro_dietiker
I will update the patch for deprecated and other non-functional clean-up fixes as a combined patch soon.
Comment #5
shiva srikanth t commentedComment #6
shiva srikanth t commentedComment #7
shiva srikanth t commented@miro_dietiker
I have attached new patch with all deprecated and other non-functional clean-up fixes as a combined patch.
Please review the code.
Comment #8
tduong commentedGood job! But after going to admin/help/entity_reference_revisions there were some errors/exceptions, so you need to fix (+ small refactoring) as follow:
Call
->toString()after Url::formRoute() (likeUrl::fromRoute(...)->toString()), and replace the " ! " with " : ", for :field_help, :er_do and ...... for :field_ui, also call ->toString() here as well.
And add the Drupal\Core\Url import.
Saw an unused import in this class (use Drupal\Core\Field\FieldItemList).
Please fix the path of the class docblock (missing Tests subclass).
Otherwise looks fine to me! :)
Comment #9
shiva srikanth t commented@tduong
I have done with all changes except following
Please fix the path of the class docblock (missing Tests subclass).
could you let me know what's need to be add.
Comment #10
miro_dietiker@sskt please also upload intermediate patches to make tests run.
Comment #11
tduong commented@sskt just do "\Drupal\entity_reference_revisions\Tests\EntityReferenceRevisionsAutocompleteTest."
And yes, please add also the interdiff file to easily review your changes between two patches (if you wonder how to do that, see https://www.drupal.org/documentation/git/interdiff).
Comment #12
shiva srikanth t commentedUpdated patch with changes.
Comment #13
shiva srikanth t commentedComment #14
tduong commentedGreat! Just a small standard coding:
This was fine. Usually you don't write src in the path/namespace.
Here you can find the @file Documenting files and Namespaces standard coding documentations. Just revert this line.
Otherwise everything is fine for me! :)
Comment #15
shiva srikanth t commentedThanks @tduong,
I have make the changes.
Comment #16
shiva srikanth t commentedComment #17
tduong commentedYep, looks good to me!
Comment #18
miro_dietikerThese things are wrongly converted. The methods have been moved to different managers...
It also means there is no test coverage for that, and we want to fix this.
Comment #19
tduong commentedJust rerolled, solved a merge conflict.
Not sure how the conversions mentioned in should be fixed...
Comment #20
tduong commentedDon't know what happened with the previous interdiff... Anyway, reverted too much, set back "entity_view" in
EntityReferenceRevisionsEntityFormatter::viewElements().Comment #21
shiva srikanth t commentedComment #22
miro_dietikerFatal: This is not provided by EntityTypeManager. Newly only on EntityDisplayRepository provided by getViewModeOptions on EntityManagerWrapper.
Also i still see no new tests.
Comment #23
tduong commentedReplaced the wrong conversions:
- injected
$entityDisplayRepositoryin EntityReferenceRevisionsEntityFormatter- used
\Drupal::getContainer()->get('entity.repository')in EntityReferenceRevisionsItemI've just learnt something new and dropped all @file comments for classes / interfaces / traits according to the @file doc standard coding.
I think the test for the view mode options (called by EntityDisplayRepositoryInterface) is already covered in EntityReferenceRevisionsAdminTest.
Not sure about the other one: what is the good approach to test the new conversion in EntityReferenceRevisionsItem to check loading entity by uuid ?
Comment #24
miro_dietikerUnrelated code cleanups are not accepted. :-)
File a separate issue. It makes reviewing hard and if you have multiple issues like that the patches conflict!
The test can not have been covered - otherwise it would have failed.
Comment #25
miro_dietikerloadEntityByUuid() is about the default value. Create a field and check config if the dependencies are properly created.
Comment #26
tduong commentedInterdiff against patch #20:
- fix wrong manager conversions
- test checking the configuration dependencies
Created follow-up #2709241: Drop @file path documentation according to standard coding
Comment #27
tduong commentedNeed to think how to get a failing test_only patch.
Comment #28
tduong commentedRerolled. @Berdir said he will take a look for this test as soon as he has time.
Comment #29
berdirOk, this is a bit more complicated. Lets go back to just do the fix without changing the test here, and open a new issue to test entity reference revisions default values and configuration dependencies.
Basically, what you need to do is the following:
'default_value' => [
[
'target_id' => $composite->id(),
'revision_id' => $composite->getRevisionId(),
]
]
To the field config, so it uses that reference as the default. When you try that, you'll notice that you get an invalid config schema error, we are missing schema for the field type value. The new issue can do that.
Comment #30
tduong commentedDropped test and shortened the "array syntax" according to the array standard coding (just in entity_reference_revisions.module for now). This is not *that* important, but since this issue is about "deprecated and other non-functional clean-up fixes" it may make sense to edit them here for the whole ERR module, but sure it will conflict with a lot of other issues...
Created follow-up: #2711429: Test ERR default values and configuration dependencies.
Comment #31
berdirWe should definitely be careful with mixing so many changes. However, only one case seems to touch code that doesn't already change, so that's pretty OK.
Comment #32
miro_dietikerCommitting this, changes also look fine for me.