Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
easychart
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
easychart
Merge requests
!1
Issue
#3217949
- Drupal 9 Support
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Issue
#3217949
- Drupal 9 Support
issue/easychart-3217949:3217949-drupal-9-compatibility
into
8.x-3.x
Overview
0
Commits
2
Pipelines
0
Changes
6
Closed
El Shobkshy
requested to merge
issue/easychart-3217949:3217949-drupal-9-compatibility
into
8.x-3.x
4 years ago
Overview
0
Commits
2
Pipelines
0
Changes
6
Expand
Drupal 9 compatibility Closes
#3217949
0
0
Merge request reports
Compare
8.x-3.x
8.x-3.x (base)
and
latest version
latest version
95ab01b3
2 commits,
4 years ago
6 files
+
66
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
Conflict: This file was modified in both the source and target branches. Ask someone with write access to resolve it.
src/Form/OptionsForm.php
+
31
−
3
Options
@@ -7,13 +7,41 @@
namespace
Drupal\easychart\Form
;
use
Drupal\Core\File\FileSystemInterface
;
use
Drupal\Core\Form\FormBase
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\HttpFoundation\Request
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Url
;
class
OptionsForm
extends
FormBase
{
/**
* The file system service.
*
* @var \Drupal\Core\File\FileSystemInterface
*/
protected
$fileSystem
;
/**
* OptionsForm constructor.
*
* @param \Drupal\Core\File\FileSystemInterface $file_system
* The file handler.
*/
public
function
__construct
(
FileSystemInterface
$file_system
=
NULL
)
{
$this
->
fileSystem
=
$file_system
;
}
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
)
{
return
new
static
(
$container
->
get
(
'file_system'
)
);
}
/**
* {@inheritdoc}
*/
@@ -94,11 +122,11 @@ class OptionsForm extends FormBase {
}
// Write to file.
file_unmanaged_
save
_d
ata
(
json_encode
(
$current_options
),
'public://easychart-options.json'
,
F
ILE_
EXISTS_REPLACE
);
drupal_set_m
essage
(
$this
->
t
(
'The configuration options have been saved.'
));
$this
->
fileSystem
->
save
D
ata
(
json_encode
(
$current_options
),
'public://easychart-options.json'
,
F
ileSystemInterface
::
EXISTS_REPLACE
);
$this
->
messenger
()
->
addM
essage
(
$this
->
t
(
'The configuration options have been saved.'
));
}
else
{
drupal_set_m
essage
(
$this
->
t
(
'Something went wrong saving the options.'
));
$this
->
messenger
()
->
addM
essage
(
$this
->
t
(
'Something went wrong saving the options.'
));
}
}
Loading