diff --git a/configbit/extra.components.varbase.bit.yml b/configbit/extra.components.varbase.bit.yml index e30a4638..764bf9da 100644 --- a/configbit/extra.components.varbase.bit.yml +++ b/configbit/extra.components.varbase.bit.yml @@ -21,7 +21,7 @@ config_bit: description: 'Adds an automatic checker tool for accessibility with the integration of the Editoria11y Accessibility Checker, a user-friendly tool dedicated to automatically identifying and addressing straightforward accessibility issues in various contexts.' selected: true config_form: false - in_varbase_demo: true + in_varbase_demo: false vmi: title: "View Modes Inventory" description: "The most common view modes you'll need for almost any site. This will provide you with a set of content View Modes for various teaser styles. All of which are mobile-first, media-aware, and ready for you to customize your site." @@ -39,13 +39,13 @@ config_bit: description: 'Provides the necessary tools to build carousels in your website. You will be able to create carousels on the spot and place it anywhere in the site.' selected: false config_form: false - in_varbase_demo: true + in_varbase_demo: false varbase_search: title: "Varbase Search" description: 'A suite of site search engine tools to help you build better search performance, customization, and search experience. Built using Search API.' selected: false config_form: false - in_varbase_demo: true + in_varbase_demo: false varbase_blog: title: "Varbase Blog" description: "Provides the necessary tools to build blogs in your website." @@ -58,22 +58,22 @@ config_bit: selected: false config_form: true formbit: "src/FormBit/varbase_auth.formbit.php" - in_varbase_demo: true + in_varbase_demo: false varbase_api: title: "Varbase API" description: "A JSON:API implementation with authentication and authorization that allows for easy ingestion of content by other applications." selected: false config_form: false - in_varbase_demo: true + in_varbase_demo: false google_analytics: title: "Google Analytics" description: 'Adds the Google Analytics web statistics tracking system to your website.' selected: false config_form: false - in_varbase_demo: true + in_varbase_demo: false google_tag: title: "Google Tag Manager" description: 'Adds an integration with the Google Tag Manager (GTM) application.' selected: false config_form: false - in_varbase_demo: true + in_varbase_demo: false diff --git a/src/Form/AssemblerForm.php b/src/Form/AssemblerForm.php index d819ddf5..43e249be 100644 --- a/src/Form/AssemblerForm.php +++ b/src/Form/AssemblerForm.php @@ -93,7 +93,6 @@ public function buildForm(array $form, FormStateInterface $form_state, array &$i if (count($demoContent) > 0) { $form['demo_content'] = [ '#type' => 'fieldset', - // '#title' => $this->t('Demo'), ]; foreach ($demoContent as $demo_content_key => $demo_content_info) { @@ -163,7 +162,6 @@ public function buildForm(array $form, FormStateInterface $form_state, array &$i $form['extra_features'] = [ '#type' => 'fieldset', - // '#title' => $this->t('Recipes'), ]; foreach ($extraFeatures as $extra_feature_key => $extra_feature_info) { @@ -202,9 +200,6 @@ public function buildForm(array $form, FormStateInterface $form_state, array &$i 'disabled' => [ ':input[name="varbase_demo"]' => ['checked' => TRUE], ], - 'enabled' => [ - ':input[name="varbase_demo"]' => ['checked' => FALSE], - ], ]; } else { @@ -212,27 +207,9 @@ public function buildForm(array $form, FormStateInterface $form_state, array &$i 'disabled' => [ ':input[name="varbase_demo"]' => ['checked' => TRUE], ], - 'enabled' => [ - ':input[name="varbase_demo"]' => ['checked' => FALSE], - ], 'checked' => [ ':input[name="varbase_demo"]' => ['checked' => TRUE], ], - 'unchecked' => [ - ':input[name="varbase_demo"]' => ['checked' => FALSE], - ], - ]; - } - } - else { - if ($checkbox_selected) { - $form['extra_features'][$extra_feature_key]['#states'] = [ - 'disabled' => [ - ':input[name="varbase_demo"]' => ['checked' => TRUE], - ], - 'enabled' => [ - ':input[name="varbase_demo"]' => ['checked' => FALSE], - ], ]; } } diff --git a/varbase.profile b/varbase.profile index 7054ebe4..63c7013f 100644 --- a/varbase.profile +++ b/varbase.profile @@ -542,58 +542,15 @@ function varbase_uninstall_component($uninstall_component) { */ function varbase_reset_timestamp_for_default_content($reset) { + // Reset timestamp for default content. if ($reset) { - // Reset timestamp for all file's default content. - $file_storage = \Drupal::service('entity_type.manager')->getStorage('file'); - $file_ids = $file_storage->getQuery() - ->accessCheck(FALSE) - ->execute(); - - if (isset($file_ids) - && is_array($file_ids) - && count($file_ids) > 0) { - - foreach ($file_ids as $fid) { - $file = \Drupal::service('entity_type.manager')->getStorage('file')->load($fid); - if (isset($file)) { - $file->set('created', \Drupal::time()->getCurrentTime()); - $file->save(); - } - } - } - - // Reset timestamp for all Media's default content. - $media_storage = \Drupal::service('entity_type.manager')->getStorage('media'); - $media_ids = $media_storage->getQuery() - ->accessCheck(FALSE) - ->execute(); - - if (isset($media_ids) - && is_array($media_ids) - && count($media_ids) > 0) { - - foreach ($media_ids as $mid) { - $media = \Drupal::service('entity_type.manager')->getStorage('media')->load($mid); - if (isset($media)) { - $media->set('created', \Drupal::time()->getCurrentTime()); - $media->save(); - } - } - } - - // Reset timestamp for all Node's default content. - $node_storage = \Drupal::service('entity_type.manager')->getStorage('node'); - $node_ids = $node_storage->getQuery()->accessCheck(FALSE)->execute(); - if (isset($node_ids) - && is_array($node_ids) - && count($node_ids) > 0) { - - foreach ($node_ids as $nid) { - $node = \Drupal::service('entity_type.manager')->getStorage('node')->load($nid); - if (isset($node)) { - $node->set('created', \Drupal::time()->getCurrentTime()); - $node->save(); - } + // Only for the Homepage, blog, and Contact Us default content pages. + $node_ids = [1, 2, 3]; + foreach ($node_ids as $nid) { + $node = \Drupal::service('entity_type.manager')->getStorage('node')->load($nid); + if (isset($node)) { + $node->set('created', \Drupal::time()->getCurrentTime()); + $node->save(); } } }