Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
field system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Oct 2012 at 16:25 UTC
Updated:
29 Jul 2014 at 21:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fubhy commentedIf there are no objections to do this then I would re-factor the parts in core where we are currently by-passing that function.
Comment #2
swentel commentedfield_ui_bundle_admin_path.patch queued for re-testing.
Comment #4
webflo commentedRerolled.
Comment #5
swentel commentedThat's because field_ui can be disabled. So I guess that's a valid reason to make it private.
Comment #6
yched commentedWell, it's a function provided by field_ui, so making it public would mean usual caller precautions to check if the module is enabled.
I'd say this makes sense. Other modules might want to link to field UI pages.
Comment #7
fabianx commented#4: field_ui_bundle_admin_path-1824244-4.patch queued for re-testing.
Comment #8
webchickCommitted and pushed to 8.x. Thanks!
This will need a change notice.
Comment #9
fubhy commentedThis still needs a follow-up to find the parts in core where we are hard-coding the path to existing manage fields / manage display pages (if there are any?).
Comment #10
swentel commentedThis broke the translations tab, patch attached,
Comment #11
swentel commentedChange notice also added at http://drupal.org/node/1848180
Comment #12
fubhy commentedComment #13
catchOK this could do with some test coverage, but it suggests we've got no coverage of that page at all at the moment. Moving back to major task to add that. Committed/pushed the fix to 8.x.
Comment #14
csg commentedI created this patch for #1849316: Undefined function _field_ui_bundle_admin_path when no field is translatable but it seems to be a duplicate of this issue so I upload it here instead. This checks if the Translate page of a translatable node type without any translatable fields is rendered correctly.
If you think more test coverage is needed, please specify, and I'll try to help.
Comment #16
swentel commentedSpaces (or tabs, they shouldn't be there).
Same here
Comment #17
csg commentedI removed all unnecessary spaces and re-rolled the patch.
Comment #19
csg commentedComment #20
swentel commentedLooks good to me, RTBC when it comes back green.
Comment #22
gábor hojtsyThe patch should have the fix too not just the test :)
Comment #23
csg commented#19: node_field_translation_test-1824244-19.patch queued for re-testing.
Comment #24
swentel commented@Gábor - the fix has been committed in #13 already :)
Comment #25
csg commentedSince my last patch the fix got in, so I re-test the previous patch.
Comment #27
csg commentedThe test failed because it requires the field_ui module and it wasn't enabled. I fixed that, and also added another test that checks if the Translate page of a translatable node type with translatable fields is rendered correctly.
Comment #28
gábor hojtsyI don't think these two need to be separate functions. You can do an assert before the field is removed and an assert after?
These two can/should be local variables since the tests don't have global variables for this I believe.
Also, the permissions granted are too wide for this task. Sounds like 'translate any entity' is required to access this node translation page and 'access administration pages' was needed for the field UI? It would be great to test with just the permissions needed.
For that, the test class has a translator user which you can maybe use (see other tests).
Comment #29
csg commentedThanks for the review! I merged the two functions, changed the variables, and eliminated unnecessary permissions.
Comment #30
xanoFor readability, it is recommended to put every item of an associative array on its own line.
// Edit: I know it's a widely used pattern, but it's still a lot less readable than putting items on separate lines.
Comment #31
gábor hojtsyXano: this is a very widely used pattern when only a couple arguments are specified. Some examples:
Comment #32
csg commented@Xano: Every other function of this class uses the same pattern, so I think it's more consistent this way. Are you sure it would be feasible to change it?
Thanks to both of you for the review!
Comment #33
mr.york commentedI tested this patch. It works fine.
Comment #34
swentel commentedExtreme nitpick, but it's a new guideline for tests.
We don't use t() anymore in asserts. Either simply use quotes and if you need to replace variables, use format_string()
Same here, otherwise looks good though.
Comment #35
csg commented@swentel: Thanks for the review! I removed t() from both asserts, please review again.
Comment #37
csg commentedErm, I had been tinkering a little more with the permissions to see if I can narrow it down any further, and forgot to change it back... Now it's fixed.
Please review it once again!
Comment #39
csg commented#37: node_field_translation_test-1824244-37.patch queued for re-testing.
Comment #40
csg commentedPrevious result: FAILED: [[SimpleTest]]: [MySQL] Failed to run tests: failed during invocation of run-tests.sh.
Since it has nothing to do with my patch, I queued it for re-testing.
Comment #41
swentel commentedAlright, let's get this in.
Comment #42
webchickCommitted and pushed to 8.x. Thanks!
Comment #44
xjm