Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
node system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Jul 2013 at 10:22 UTC
Updated:
29 Jul 2014 at 22:39 UTC
Jump to comment: Most recent file
Comments
Comment #1
berdirAnd here we go.
Comment #2
dawehnerYou should not simply even try to review that via dreditor.
Both isset($node->nid) and !empty($node->nid) should be converted to the same statement. It feels like just $node->id() is the proper thing to do
This change is potentially wrong. Shouldn't that be $item->nid = $node->id()?
Let's use single quotes as well.
So translation is also of type NodeInterface according to the clones above. Let's fix the documentation of assertLanguageSwitchLinks as well.
Comment #3
berdirThanks for the review!
$translation is a mess, sometimes it's just a stdclass. That was one of the uglier things to track down here.
Comment #4
xanoI propose sticking to isNew(). Checking id() might be faster, but it was never made for this purpose, so we may set a wrong example by using it instead of isNew().
Comment #5
berdirAgree with @Xano in this case, isNew() feels more self-documenting in this case, we're not interesting if the node has an id or not, we want to know if we're creating a new node or editing an existing one. That's not generally true, tough, there are cases where it makes more sense to check if we have an id. So I'd rather fix cases where we check for id() that don't make sense.
Fixed Rss.php and NodeAccessFieldTest.php.
Comment #6
dawehnerAt least this instance would make sense, most of the other ones actually care more about the id()
Comment #7
berdirChange that one then :)
Comment #8
berdirFound a few more ->nid's while looking at the remaining NG test fails.
Comment #10
oriol_e9gout of scope:
We can add a separate issue for the remaining title -> label conversions.
Comment #11
berdirAll of them are already converted in the master patch in #1939994: Complete conversion of nodes to the new Entity Field API, that one just got in accidentally as it's close to id() changes and i missed that when moving changes to the right commit.
Comment #12
berdirFixed the wrong id() in the breadcrumb test and even more nid -> id() conversions.
Comment #13
berdir#12: node-methods-2041287-12.patch queued for re-testing.
Comment #14
dawehnerNice!
Comment #15
berdir#12: node-methods-2041287-12.patch queued for re-testing.
Comment #16
alexpottAsked berdir about this on IRC... he said "Looking at the code, I don't see how it could possibly ever be a NodeInterface"
Comment #17
berdirRemoved that part.
Comment #18
berdirIgnore the first patch/interdiff, that is bogus, accidently had a label() in there again.
Comment #19
dawehnerGood catch in #16! This interdiff looked fine.
Comment #20
alexpottCommitted ad13753 and pushed to 8.x. Thanks!
Comment #21
berdirComment #23
berdirRemoving sprint tag.
Comment #24
berdirRemoving sprint tag.
Comment #24.0
berdirUpdated issue summary.