From 6859786e6f95f2147a4d78951417b18119f82c52 Mon Sep 17 00:00:00 2001 From: weryques Date: Wed, 6 Jun 2018 12:45:25 -0300 Subject: [PATCH] on entity factory and rest items controller On dev interface fixes PHP Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) --- src/api/endpoints/class-tainacan-rest-items-controller.php | 3 ++- tests/factories/class-tainacan-entity-factory.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/endpoints/class-tainacan-rest-items-controller.php b/src/api/endpoints/class-tainacan-rest-items-controller.php index 8b52e58ea..21cb12e33 100644 --- a/src/api/endpoints/class-tainacan-rest-items-controller.php +++ b/src/api/endpoints/class-tainacan-rest-items-controller.php @@ -225,7 +225,8 @@ class REST_Items_Controller extends REST_Controller { if ( isset($request['view_mode']) ) { // TODO: Check if requested view mode is really enabled for current collection - $view_mode = \Tainacan\Theme_Helper::get_instance()->get_view_mode($request['view_mode']); + $view_mode = \Tainacan\Theme_Helper::get_instance(); + $view_mode = $view_mode->get_view_mode($request['view_mode']); if ($view_mode && $view_mode['type'] == 'template' && isset($view_mode['template']) && file_exists($view_mode['template'])) { $return_template = true; diff --git a/tests/factories/class-tainacan-entity-factory.php b/tests/factories/class-tainacan-entity-factory.php index 6ae2b01bf..b97fe6af2 100644 --- a/tests/factories/class-tainacan-entity-factory.php +++ b/tests/factories/class-tainacan-entity-factory.php @@ -57,7 +57,8 @@ class Entity_Factory { } $this->entity = new $this->entity_type(); - $this->repository = $this->repository_type::get_instance(); + $repo = $this->repository_type; + $this->repository = $repo::get_instance(); if($publish) { $this->entity->set_status('publish');