Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
QUIQQER
package-bricks
Commits
6da95366
Commit
6da95366
authored
Oct 10, 2019
by
Henning Leutz
🥋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: brick typ check at brick saving
parent
186da628
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
81 deletions
+139
-81
locale.xml
locale.xml
+114
-80
src/QUI/Bricks/Manager.php
src/QUI/Bricks/Manager.php
+25
-1
No files found.
locale.xml
View file @
6da95366
This diff is collapsed.
Click to expand it.
src/QUI/Bricks/Manager.php
View file @
6da95366
...
...
@@ -887,13 +887,37 @@ class Manager
}
}
$type
=
$Brick
->
getAttribute
(
'type'
);
$checkType
=
function
(
$type
)
{
if
(
$type
===
'content'
)
{
return
true
;
}
if
(
\
is_callable
(
$type
))
{
return
true
;
}
if
(
\
class_exists
(
$type
))
{
return
true
;
}
throw
new
QUI\Exception
(
'quiqqer/bricks'
,
'exception.type.is.not.allowed'
);
};
$checkType
(
$type
);
// update
QUI
::
getDataBase
()
->
update
(
$this
->
getTable
(),
[
'title'
=>
$Brick
->
getAttribute
(
'title'
),
'frontendTitle'
=>
$Brick
->
getAttribute
(
'frontendTitle'
),
'description'
=>
$Brick
->
getAttribute
(
'description'
),
'content'
=>
$Brick
->
getAttribute
(
'content'
),
'type'
=>
$
Brick
->
getAttribute
(
'
type
'
)
,
'type'
=>
$type
,
'settings'
=>
\
json_encode
(
$Brick
->
getSettings
()),
'customfields'
=>
\
json_encode
(
$customfields
),
'areas'
=>
$areaString
,
...
...
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