[buddypress-trac] [BuddyPress Trac] #5472: xprofile_insert_field -> type - 'option' not allowed?

buddypress-trac noreply at wordpress.org
Sun Jun 15 17:20:40 UTC 2014


#5472: xprofile_insert_field -> type - 'option' not allowed?
------------------------------+---------------------------
 Reporter:  shanebp           |       Owner:  boonebgorges
     Type:  defect (bug)      |      Status:  reopened
 Priority:  normal            |   Milestone:  2.1
Component:  XProfile          |     Version:  1.9.2
 Severity:  normal            |  Resolution:
 Keywords:  needs-unit-tests  |
------------------------------+---------------------------

Comment (by shanebp):

 >I don't really understand what you're describing with the autoincrement
 stuff.

 Say the countries script inserts 200 countries.
 And say the database row, for the field type = selectbox, has an id of 10.
 Then the last countries option row id would be 210.
 And the display order of the options follows the field_order.

 Then delete the Country field, via page=bp-profile-setup, and run the
 countries script again.
 The database row, for the field type = selectbox, now has an id of 211.
 Then the last countries option row id would be 411.
 But the display order of the options does not follow the field_order.

 If I delete the Country field again, and manually change the database
 table's auto-increment value to 10 and run the script again, the the
 display order of the options will follow the field_order.


 Not sure if this matters, but I notice in your field test, you are using
 this to create the parent:
 $parent = $this->factory->xprofile_field->create
 Instead of xprofile_insert_field

 If you change your unit test to:
 - use a loop to insert a handful of options and increment the field order
 - delete the parent and all the options
 - run the insert parent and options again

 The test will '''not fail''', but the display order will not ( afaik )
 follow the field_order.

 I sorry, but I'm not sure how to write a unit test that reveals if display
 order honors the field_order.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5472#comment:12>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list