"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

Amitaibu - November 8, 2009 - 08:56

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

yched - November 8, 2009 - 15:16
Status:active» needs review

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.

AttachmentSizeStatusTest resultOperations
field_ui_add_existing_field.patch2.2 KBIdleFailed: 14679 passes, 10 fails, 0 exceptionsView details | Re-test

#3

Amitaibu - November 8, 2009 - 15:35

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.

AttachmentSizeStatusTest resultOperations
626664-field_ui_add_existing_field-3.patch2.97 KBIdleFailed: 14705 passes, 11 fails, 0 exceptionsView details | Re-test

#4

yched - November 8, 2009 - 16:26

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

AttachmentSizeStatusTest resultOperations
626664-field_ui_add_existing_field-5.patch3.31 KBIdleFailed: 14667 passes, 19 fails, 336 exceptionsView details | Re-test

#5

Amitaibu - November 8, 2009 - 16:45

minor:

+    // different entity types; .g. if a field was added in a node entity, it

should be e.g.

#6

yched - November 8, 2009 - 17:53

Oopsie :-)

AttachmentSizeStatusTest resultOperations
626664-field_ui_add_existing_field-7.patch3.3 KBIdleFailed: 14678 passes, 20 fails, 338 exceptionsView details | Re-test

#7

System Message - November 8, 2009 - 19:15
Status:needs review» needs work

The last submitted patch failed testing.

#8

yched - November 8, 2009 - 21:21
Status:needs work» needs review

Re test please.

AttachmentSizeStatusTest resultOperations
626664-field_ui_add_existing_field-7.patch3.3 KBIdleFailed: 14698 passes, 11 fails, 2 exceptionsView details | Re-test

#9

System Message - November 8, 2009 - 21:35
Status:needs review» needs work

The last submitted patch failed testing.

#10

yched - November 9, 2009 - 01:26
Status:needs work» needs review

Doh, wrong boolean logic...

AttachmentSizeStatusTest resultOperations
626664-field_ui_add_existing_field-10.patch3.75 KBIdlePassed: 14687 passes, 0 fails, 0 exceptionsView details | Re-test

#11

Amitaibu - November 9, 2009 - 13:13
Status:needs review» reviewed & tested by the community

Tests pass, and functionality is fixed as-well.

#12

webchick - November 11, 2009 - 06:58
Status:reviewed & tested by the community» fixed

Committed to HEAD.

#13

System Message - November 25, 2009 - 07:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.