Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
229
Merge Requests
229
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
648e3622
Commit
648e3622
authored
Dec 06, 2013
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2132551
by Gábor Hojtsy, alexpott, kfritsche: Picture module uses config keys with a dot.
parent
afa7d30c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
7 deletions
+27
-7
core/modules/picture/config/schema/picture.schema.yml
core/modules/picture/config/schema/picture.schema.yml
+9
-3
core/modules/picture/lib/Drupal/picture/Entity/PictureMapping.php
...ules/picture/lib/Drupal/picture/Entity/PictureMapping.php
+18
-4
No files found.
core/modules/picture/config/schema/picture.schema.yml
View file @
648e3622
...
...
@@ -18,10 +18,16 @@ picture.mappings.*:
label
:
'
Mappings'
sequence
:
-
type
:
sequence
label
:
'
Mapping
'
label
:
'
Source
type
'
sequence
:
-
type
:
string
label
:
'
Image
style'
-
type
:
sequence
label
:
'
Source'
sequence
:
-
type
:
sequence
label
:
'
Machine
name'
sequence
:
-
type
:
string
label
:
'
Image
style'
breakpointGroup
:
type
:
string
label
:
'
Breakpoint
group'
...
...
core/modules/picture/lib/Drupal/picture/Entity/PictureMapping.php
View file @
648e3622
...
...
@@ -95,6 +95,16 @@ public function save() {
if
(
isset
(
$this
->
breakpointGroup
)
&&
is_object
(
$this
->
breakpointGroup
))
{
$this
->
breakpointGroup
=
$this
->
breakpointGroup
->
id
();
}
// Split the breakpoint ids into their different parts, as dots as
// identifiers are not possible.
$loaded_mappings
=
$this
->
mappings
;
$this
->
mappings
=
array
();
foreach
(
$loaded_mappings
as
$breakpoint_id
=>
$mapping
)
{
list
(
$source_type
,
$source
,
$name
)
=
explode
(
'.'
,
$breakpoint_id
);
$this
->
mappings
[
$source_type
][
$source
][
$name
]
=
$mapping
;
}
parent
::
save
();
$this
->
loadBreakpointGroup
();
$this
->
loadAllMappings
();
...
...
@@ -129,10 +139,14 @@ protected function loadAllMappings() {
$this
->
mappings
=
array
();
if
(
$this
->
breakpointGroup
)
{
foreach
(
$this
->
breakpointGroup
->
getBreakpoints
()
as
$breakpoint_id
=>
$breakpoint
)
{
// Get the components of the breakpoint ID to match the format of the
// configuration file.
list
(
$source_type
,
$source
,
$name
)
=
explode
(
'.'
,
$breakpoint_id
);
// Get the mapping for the default multiplier.
$this
->
mappings
[
$breakpoint_id
][
'1x'
]
=
''
;
if
(
isset
(
$loaded_mappings
[
$
breakpoint_id
][
'1x'
]))
{
$this
->
mappings
[
$breakpoint_id
][
'1x'
]
=
$loaded_mappings
[
$
breakpoint_id
][
'1x'
];
if
(
isset
(
$loaded_mappings
[
$
source_type
][
$source
][
$name
][
'1x'
]))
{
$this
->
mappings
[
$breakpoint_id
][
'1x'
]
=
$loaded_mappings
[
$
source_type
][
$source
][
$name
][
'1x'
];
}
// Get the mapping for the other multipliers.
...
...
@@ -140,8 +154,8 @@ protected function loadAllMappings() {
foreach
(
$breakpoint
->
multipliers
as
$multiplier
=>
$status
)
{
if
(
$status
)
{
$this
->
mappings
[
$breakpoint_id
][
$multiplier
]
=
''
;
if
(
isset
(
$loaded_mappings
[
$
breakpoint_id
][
$multiplier
]))
{
$this
->
mappings
[
$breakpoint_id
][
$multiplier
]
=
$loaded_mappings
[
$
breakpoint_id
][
$multiplier
];
if
(
isset
(
$loaded_mappings
[
$
source_type
][
$source
][
$name
][
$multiplier
]))
{
$this
->
mappings
[
$breakpoint_id
][
$multiplier
]
=
$loaded_mappings
[
$
source_type
][
$source
][
$name
][
$multiplier
];
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment