Currently we are doing this to create a new view:

    $view = views_new_view();
    $view->name = $form_state['values']['name'];
    $view->human_name = $form_state['values']['human_name'];
    $view->description = $form_state['values']['description'];
    $view->tag = 'default';
    $view->core = VERSION;
    $view->base_table = $this->base_table;

We should pass these parameters (only ones that are needed) into a create method instead. I have also created a views_create_view wrapper function for entity_create as we currently have for views_new_view.

The patch also contains a couple of small doc amends.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

+++ b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.phpundefined
@@ -543,18 +543,19 @@ abstract class WizardPluginBase extends PluginBase implements WizardInterface {
-    $view->tag = 'default';

I totally agree that using 'default' for a tag doesn't make sense, but why remote 'core' out of that?

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Just clarified that core gets set by ViewStorage.

damiankloip’s picture

Title: Update view creation code in instantiate_plugin method in WizardPluginBase » Add views_create_view wrapper function and update view creation code in instantiate_plugin method of WizardPluginBase
damiankloip’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x

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