Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMS-2193-update-d9 - making d9 compliant #3

Open
wants to merge 1 commit into
base: 8.x-1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qubit_lite.info.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Qubit Lite
type: module
description: A small iframe version of the Qubit tracking integration
core: 8.x
core_version_requirement: ^8 || ^9 || ^10
package: Statistics
1 change: 0 additions & 1 deletion qubit_lite.links.menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ qubit_lite.qubit_lite_settings_form:
description: 'Settings for Qubit Lite'
parent: system.admin_config_system
weight: 99

6 changes: 4 additions & 2 deletions src/Controller/QubitTrackingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function setRouterContext(AdminContext $admin_context) {
/**
* A router callback to generate the tracking page.
*
* @return Response
* @return \Drupal\Core\Cache\CacheableResponse\Response
* A Symfony response object representing the tracking page.
*/
public function build() {
Expand Down Expand Up @@ -99,7 +99,9 @@ public function onCurrentPage() {

/**
* Load biscotti script if the settings are not empty.
*
* @return bool|Response
* Returns a new response.
*/
public function loadBiscotti() {
$config = $this->config('qubit_lite.settings');
Expand All @@ -125,7 +127,7 @@ public function loadBiscotti() {
}
else {
$domains = explode(PHP_EOL, $biscotti_safe_domains);
$new_domains = array();
$new_domains = [];
foreach ($domains as $domain) {
$trim = trim($domain);
$new_domains[] = "'" . $trim . "'";
Expand Down
20 changes: 10 additions & 10 deletions src/Form/QubitLiteSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,39 @@ public function getFormId() {
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('qubit_lite.settings');
$form['customer_id'] = array(
$form['customer_id'] = [
'#type' => 'textfield',
'#title' => $this->t('Customer Id'),
'#default_value' => $config->get('customer_id'),
);
];

$form['site_id'] = array(
$form['site_id'] = [
'#type' => 'textfield',
'#title' => $this->t('Site Id'),
'#default_value' => $config->get('site_id'),
);
];

$form['biscotti'] = array(
$form['biscotti'] = [
'#type' => 'fieldset',
'#title' => $this->t('Biscotti settings'),
);
];

$form['biscotti']['biscotti_url'] = array(
$form['biscotti']['biscotti_url'] = [
'#type' => 'textfield',
'#title' => $this->t('Biscotti url'),
'#default_value' => $config->get('biscotti_url'),
'#size' => 60,
'#maxlength' => 128,
'#required' => TRUE,
);
];

$form['biscotti']['biscotti_safe_domains'] = array(
$form['biscotti']['biscotti_safe_domains'] = [
'#type' => 'textarea',
'#title' => $this->t('Safe domains'),
'#default_value' => $config->get('biscotti_safe_domains'),
'#description' => $this->t('Add one domain per line'),
'#required' => TRUE,
);
];

return parent::buildForm($form, $form_state);
}
Expand Down