Holy tomatos. This shouldn't include .git files in it should it?

Hmm. I want "Insert Media" in a HtmlEditorField to use Upload::uploads_folder config... but there seems to be no way to define that?

Solved that particular problem with this:

  1. public static function setUpBeforeClass()
  2. {
  3. parent::setUpBeforeClass();
  4. // NOTE(Jake): 2018-08-13
  5. //
  6. // Add configs to SortableMenuExtension, then apply to
  7. // `Page` record. Because this modifies the DB fields, we need
  8. // to call `static::resetDBSchema(true, true);`
  9. //
  10. Config::modify()->set(SortableMenuExtension::class, 'menus', array(
  11. 'ShowInFooter' => array(
  12. 'Title' => 'Footer',
  13. ),
  14. 'ShowInSidebar' => array(
  15. 'Title' => 'Sidebar',
  16. ),
  17. ));
  18. Page::add_extension(SortableMenuExtension::class);
  19. static::resetDBSchema(true, true);
  20. }

At the very least, I now know that the issue means that those DB fields arent applying for that test

Cheers, I'll give it a crack. But SortableMenuExtension does some funky things like building db fields from the Config of the SortableMenuExtension.

  1. public static function get_extra_config($class, $extension, $args)
  2. {
  3. if (self::$inConfigCall) {
  4. throw new SortableMenuException(__FUNCTION__.': Recursion error.');
  5. }
  6. // NOTE(Jake): If 'get_extra_config' is really aiming to be deprecated
  7. // post 3.2+, then this logic can moved to a CompositeDBField
  8. // and the setup method can migrate to that.
  9. $menus = static::get_sortable_menu_configuration();
  10. $dbFields = array();
  11. foreach ($menus as $fieldName => $extraInfo) {
  12. $dbFields[$fieldName] = DBBoolean::class;
  13. $dbFields[$extraInfo['Sort']] = 'Int';
  14. }
  15. $result = array(
  16. 'db' => $dbFields,
  17. );
  18. return $result;
  19. }

a simple workaround might be to just put all tests on 1 class

im guessing there's a global var set somewhere and its not re-executing at some level for that other test

Im also doing something funky. Im applying a config that affects building of the DB in the tests. This code run fine in SS3.

  1. public function setUp()
  2. {
  3. Config::modify()->set(SortableMenuExtension::class, 'menus', array(
  4. 'ShowInFooter' => array(
  5. 'Title' => 'Footer',
  6. ),
  7. 'ShowInSidebar' => array(
  8. 'Title' => 'Sidebar',
  9. ),
  10. ));
  11. Page::add_extension(SortableMenuExtension::class);
  12. parent::setUp();
  13. }

because otherwise it would error during setUp() function call