Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wsdata
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
wsdata
Commits
af598161
Commit
af598161
authored
5 years ago
by
Nicolae Procopan
Committed by
David Pascoe-Deslauriers
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3107495
by thebumik: Fatal error when adding new web service call
parent
7c162915
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Form/WSCallForm.php
+27
-6
27 additions, 6 deletions
src/Form/WSCallForm.php
src/Form/WSServerForm.php
+9
-2
9 additions, 2 deletions
src/Form/WSServerForm.php
with
36 additions
and
8 deletions
src/Form/WSCallForm.php
+
27
−
6
View file @
af598161
...
@@ -16,6 +16,27 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
...
@@ -16,6 +16,27 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*/
*/
class
WSCallForm
extends
EntityForm
{
class
WSCallForm
extends
EntityForm
{
/**
* WSEncoder Manager.
*
* @var Drupal\wsdata\Plugin\WSEncoderManager
*/
protected
$encoderManager
;
/**
* WSDecoder Manager.
*
* @var Drupal\wsdata\Plugin\WSDecoderManager
*/
protected
$decoderManager
;
/**
* Module Handler.
*
* @var Drupal\Core\Extension\ModuleHandlerInterface
*/
protected
$moduleHandler
;
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
...
@@ -24,9 +45,9 @@ class WSCallForm extends EntityForm {
...
@@ -24,9 +45,9 @@ class WSCallForm extends EntityForm {
WSDecoderManager
$plugin_manager_wsdecoder
,
WSDecoderManager
$plugin_manager_wsdecoder
,
ModuleHandlerInterface
$module_handler
ModuleHandlerInterface
$module_handler
)
{
)
{
$this
->
plugin_manager_wsencod
er
=
$plugin_manager_wsencoder
;
$this
->
encoderManag
er
=
$plugin_manager_wsencoder
;
$this
->
plugin_manager_wsdecod
er
=
$plugin_manager_wsdecoder
;
$this
->
decoderManag
er
=
$plugin_manager_wsdecoder
;
$this
->
module
_h
andler
=
$module_handler
;
$this
->
module
H
andler
=
$module_handler
;
}
}
/**
/**
...
@@ -125,7 +146,7 @@ class WSCallForm extends EntityForm {
...
@@ -125,7 +146,7 @@ class WSCallForm extends EntityForm {
}
}
}
}
$decoder_definitions
=
$this
->
plugin_manager_wsdecod
er
->
getDefinitions
();
$decoder_definitions
=
$this
->
decoderManag
er
->
getDefinitions
();
$options
=
[
''
=>
$this
->
t
(
'None'
)];
$options
=
[
''
=>
$this
->
t
(
'None'
)];
foreach
(
$decoder_definitions
as
$key
=>
$decoder
)
{
foreach
(
$decoder_definitions
as
$key
=>
$decoder
)
{
$options
[
$key
]
=
$decoder
[
'label'
]
->
render
();
$options
[
$key
]
=
$decoder
[
'label'
]
->
render
();
...
@@ -140,7 +161,7 @@ class WSCallForm extends EntityForm {
...
@@ -140,7 +161,7 @@ class WSCallForm extends EntityForm {
'#default_value'
=>
$wscall_entity
->
wsdecoder
,
'#default_value'
=>
$wscall_entity
->
wsdecoder
,
];
];
$encoder_definitions
=
$this
->
plugin_manager_wsencod
er
->
getDefinitions
();
$encoder_definitions
=
$this
->
encoderManag
er
->
getDefinitions
();
$options
=
[
''
=>
$this
->
t
(
'None'
)];
$options
=
[
''
=>
$this
->
t
(
'None'
)];
foreach
(
$encoder_definitions
as
$key
=>
$encoder
)
{
foreach
(
$encoder_definitions
as
$key
=>
$encoder
)
{
$options
[
$key
]
=
$encoder
[
'label'
]
->
render
();
$options
[
$key
]
=
$encoder
[
'label'
]
->
render
();
...
@@ -155,7 +176,7 @@ class WSCallForm extends EntityForm {
...
@@ -155,7 +176,7 @@ class WSCallForm extends EntityForm {
'#default_value'
=>
$wscall_entity
->
wsencoder
,
'#default_value'
=>
$wscall_entity
->
wsencoder
,
];
];
if
(
!
$this
->
module
_h
andler
->
moduleExists
(
'wsdata_extras'
))
{
if
(
!
$this
->
module
H
andler
->
moduleExists
(
'wsdata_extras'
))
{
$form
[
'wsdecoder'
][
'#description'
]
.
=
' '
.
$this
->
t
(
'Looking for more decoder plugins? Try enabling the <em>wsdata_extras</em> module.'
);
$form
[
'wsdecoder'
][
'#description'
]
.
=
' '
.
$this
->
t
(
'Looking for more decoder plugins? Try enabling the <em>wsdata_extras</em> module.'
);
$form
[
'wsencoder'
][
'#description'
]
.
=
' '
.
$this
->
t
(
'Looking for more encoder plugins? Try enabling the <em>wsdata_extras</em> module.'
);
$form
[
'wsencoder'
][
'#description'
]
.
=
' '
.
$this
->
t
(
'Looking for more encoder plugins? Try enabling the <em>wsdata_extras</em> module.'
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/Form/WSServerForm.php
+
9
−
2
View file @
af598161
...
@@ -15,11 +15,18 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
...
@@ -15,11 +15,18 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*/
*/
class
WSServerForm
extends
EntityForm
{
class
WSServerForm
extends
EntityForm
{
/**
* Connector Manager.
*
* @var Drupal\wsdata\Plugin\WSConnectorManager
*/
protected
$connectorManager
;
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
__construct
(
WSConnectorManager
$plugin_manager_wsconnector
,
MessengerInterface
$messenger
)
{
public
function
__construct
(
WSConnectorManager
$plugin_manager_wsconnector
,
MessengerInterface
$messenger
)
{
$this
->
plugin_manager_ws
connector
=
$plugin_manager_wsconnector
;
$this
->
connector
Manager
=
$plugin_manager_wsconnector
;
$this
->
messenger
=
$messenger
;
$this
->
messenger
=
$messenger
;
}
}
...
@@ -81,7 +88,7 @@ class WSServerForm extends EntityForm {
...
@@ -81,7 +88,7 @@ class WSServerForm extends EntityForm {
'#required'
=>
TRUE
,
'#required'
=>
TRUE
,
];
];
$connector_definitions
=
$this
->
plugin_manager_ws
connector
->
getDefinitions
();
$connector_definitions
=
$this
->
connector
Manager
->
getDefinitions
();
$options
=
[];
$options
=
[];
foreach
(
$connector_definitions
as
$key
=>
$connector
)
{
foreach
(
$connector_definitions
as
$key
=>
$connector
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment