"Add existing field" in user doesn't show fields created in content types
Amitaibu - November 8, 2009 - 08:46
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | field_ui.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
1) Add a field in "Article" content type called field_test.
2) In admin/config/people/accounts/fields that field doesn't appear (although if you try to manually add it, an error is given).

#1
I see in the code that
$existing_field_options = field_ui_existing_field_options($obj_type, $bundle);so maybe this is by design? I think it shouldn't take the obj_type in account, and show *all* existing fields.#2
field_ui_existing_field_options() rightfully receives $obj_type, it's rather that internally it should examine all field instances, not just field instances for the current entity type.
#3
Added a test to yched's patch. I get a PDOException error on any tests on my local, so I'm not sure if the test pass.
#4
You're right, this deserves a test, thanks for this.
Attached patch moves the test at then end of the 'add new field' workflow test, removes a double parenthesis error, and uses a more accurate assert.
Test failures : yes, core is currently broken : #626866: Test bot broken - and #623992: Reduce {system} database hits
#5
minor:
+ // different entity types; .g. if a field was added in a node entity, itshould be
e.g.#6
Oopsie :-)
#7
The last submitted patch failed testing.
#8
Re test please.
#9
The last submitted patch failed testing.
#10
Doh, wrong boolean logic...
#11
Tests pass, and functionality is fixed as-well.
#12
Committed to HEAD.
#13
Automatically closed -- issue fixed for 2 weeks with no activity.