Skip to content

Commit

Permalink
Merge branch '10.2' into 10.x
Browse files Browse the repository at this point in the history
  • Loading branch information
dvesh3 committed Dec 9, 2021
2 parents 755b20a + 7d39906 commit daca0c7
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,12 @@ public function collectionsActionGet(Request $request)
if ($request->get('filter')) {
$filterString = $request->get('filter');
$filters = json_decode($filterString);

/** @var \stdClass $f */
foreach ($filters as $f) {
if (!isset($f->value)) {
continue;
}

$conditionParts[] = $db->quoteIdentifier($f->property) . ' LIKE ' . $db->quote('%' . $f->value . '%');
}
}
Expand Down Expand Up @@ -423,8 +427,12 @@ public function groupsActionGet(Request $request)
if ($request->get('filter')) {
$filterString = $request->get('filter');
$filters = json_decode($filterString);

/** @var \stdClass $f */
foreach ($filters as $f) {
if (!isset($f->value)) {
continue;
}

$conditionParts[] = $db->quoteIdentifier($f->property) . ' LIKE ' . $db->quote('%' . $f->value . '%');
}
}
Expand Down Expand Up @@ -564,8 +572,12 @@ public function collectionRelationsGetAction(Request $request)
$filters = json_decode($filterString);

$count = 0;

/** @var \stdClass $f */
foreach ($filters as $f) {
if (!isset($f->value)) {
continue;
}

if ($count > 0) {
$condition .= ' AND ';
}
Expand Down Expand Up @@ -727,8 +739,12 @@ public function searchRelationsAction(Request $request)
$db = Db::get();
$filterString = $request->get('filter');
$filters = json_decode($filterString);

/** @var \stdClass $f */
foreach ($filters as $f) {
if (!isset($f->value)) {
continue;
}

$fieldname = $mapping[$f->property];
$conditionParts[] = $fieldname . ' LIKE ' . $db->quote('%' . $f->value . '%');
}
Expand Down Expand Up @@ -837,8 +853,12 @@ public function relationsActionGet(Request $request)
$db = Db::get();
$filterString = $request->get('filter');
$filters = json_decode($filterString);

/** @var \stdClass $f */
foreach ($filters as $f) {
if (!isset($f->value)) {
continue;
}

$fieldname = $mapping[$f->field];
$conditionParts[] = $db->quoteIdentifier($fieldname) . ' LIKE ' . $db->quote('%' . $f->value . '%');
}
Expand Down Expand Up @@ -1228,8 +1248,12 @@ public function propertiesGetAction(Request $request)
if ($request->get('filter')) {
$filterString = $request->get('filter');
$filters = json_decode($filterString);

/** @var \stdClass $f */
foreach ($filters as $f) {
if (!isset($f->value)) {
continue;
}

$conditionParts[] = $db->quoteIdentifier($f->property) . ' LIKE ' . $db->quote('%' . $f->value . '%');
}
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/AdminBundle/Controller/Admin/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function csrfTokenAction(Request $request, CsrfProtectionHandler $csrfPro
}

/**
* @Route("/logout", name="pimcore_admin_logout")
* @Route("/logout", name="pimcore_admin_logout" , methods={"POST"})
*/
public function logoutAction()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,18 +269,19 @@ pimcore.element.selector.asset = Class.create(pimcore.element.selector.abstract,
},

search: function () {
var formValues = this.formPanel.getForm().getFieldValues();
let formValues = this.formPanel.getForm().getFieldValues();

var proxy = this.store.getProxy();
let proxy = this.store.getProxy();
let query = Ext.util.Format.htmlEncode(formValues.query);
proxy.setExtraParam("type", "asset");
proxy.setExtraParam("query", formValues.query);
proxy.setExtraParam("query", query);
proxy.setExtraParam("subtype", formValues.subtype);

if (this.parent.config && this.parent.config.context) {
proxy.setExtraParam("context", Ext.encode(this.parent.config.context));
}

this.pagingtoolbar.moveFirst();
this.updateTabTitle(formValues.query);
this.updateTabTitle(query);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,19 @@ pimcore.element.selector.document = Class.create(pimcore.element.selector.abstra
},

search: function () {
var formValues = this.formPanel.getForm().getFieldValues();
let formValues = this.formPanel.getForm().getFieldValues();

var proxy = this.store.getProxy();
let proxy = this.store.getProxy();
let query = Ext.util.Format.htmlEncode(formValues.query);
proxy.setExtraParam("type", "document");
proxy.setExtraParam("query", formValues.query);
proxy.setExtraParam("query", query);
proxy.setExtraParam("subtype", formValues.subtype);

if (this.parent.config && this.parent.config.context) {
proxy.setExtraParam("context", Ext.encode(this.parent.config.context));
}

this.pagingtoolbar.moveFirst();
this.updateTabTitle(formValues.query);
this.updateTabTitle(query);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,12 @@ pimcore.element.selector.object = Class.create(pimcore.element.selector.abstract
},

applyExtraParamsToStore: function () {
var formValues = this.formPanel.getForm().getFieldValues();

var proxy = this.store.getProxy();
let formValues = this.formPanel.getForm().getFieldValues();

let proxy = this.store.getProxy();
let query = Ext.util.Format.htmlEncode(formValues.query);
proxy.setExtraParam("type", "object");
proxy.setExtraParam("query", formValues.query);
proxy.setExtraParam("query", query);
proxy.setExtraParam("subtype", formValues.subtype);
proxy.setExtraParam("class", formValues.class);

Expand All @@ -591,7 +591,7 @@ pimcore.element.selector.object = Class.create(pimcore.element.selector.abstract
proxy.setExtraParam("context", Ext.encode(this.parent.config.context));
}

this.updateTabTitle(formValues.query);
this.updateTabTitle(query);
},

search: function () {
Expand Down
12 changes: 9 additions & 3 deletions bundles/AdminBundle/Resources/views/Admin/Index/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,15 @@
<div id="pimcore_avatar" style="display:none;">
<img src="{{ path('pimcore_admin_user_getimage') }}" data-menu-tooltip="{{ user.name }} | {{ 'my_profile'|trans([],'admin') }}"/>
</div>
<a id="pimcore_logout" data-menu-tooltip="{{ "logout"|trans([],'admin') }}" href="{{ path('pimcore_admin_logout') }}" style="display: none">
<img src="/bundles/pimcoreadmin/img/material-icons/outline-logout-24px.svg">
</a>
<form id="pimcore_logout_form" method="post" action="{{ path('pimcore_admin_logout') }}">
<input type="hidden" name="csrfToken" value="{{ pimcore_csrf.getCsrfToken() }}">
<a id="pimcore_logout" data-menu-tooltip="{{ "logout"|trans([],'admin') }}"
href="#" onclick="document.getElementById('pimcore_logout_form').submit();" style="display: none">
<img src="/bundles/pimcoreadmin/img/material-icons/outline-logout-24px.svg">
</a>
</form>
<div id="pimcore_signet" data-menu-tooltip="Pimcore Platform ({{ settings.version }}|{{ settings.build }})" style="text-indent: -10000px">
BE RESPECTFUL AND HONOR OUR WORK FOR FREE & OPEN SOURCE SOFTWARE BY NOT REMOVING OUR LOGO.
WE OFFER YOU THE POSSIBILITY TO ADDITIONALLY ADD YOUR OWN LOGO IN PIMCORE'S SYSTEM SETTINGS. THANK YOU!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
<button type="submit">{{ 'Login'|trans([],'admin') }}</button>
</form>

<a href="{{ path('pimcore_admin_logout') }}">{{ 'Back to Login'|trans([],'admin') }}</a>
<form id="pimcore_logout_form" method="post" action="{{ path('pimcore_admin_logout') }}">
<input type="hidden" name="csrfToken" value="{{ pimcore_csrf.getCsrfToken() }}">
<a href="#" onclick="document.getElementById('pimcore_logout_form').submit();">{{ 'Back to Login'|trans([],'admin') }}</a>
</form>



{{ pimcore_breach_attack_random_content() }}
{% endblock %}
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@
"symfony/monolog-bundle": "3.6.0",
"doctrine/doctrine-migrations-bundle": "3.1.0",
"webmozarts/console-parallelization": "1.2.2",
"thecodingmachine/safe": "<1.2.0"
"thecodingmachine/safe": "<1.2.0",
"sabre/dav": "4.2.2"
},
"require-dev": {
"cache/integration-tests": "dev-master",
Expand Down
2 changes: 1 addition & 1 deletion models/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ public function setStream($stream)
$isRewindable = @rewind($this->stream);

if (!$isRewindable) {
$tempFile = $this->getTemporaryFile();
$tempFile = $this->getLocalFileFromStream($this->stream);
$dest = fopen($tempFile, 'rb', false, File::getContext());
$this->stream = $dest;
}
Expand Down

0 comments on commit daca0c7

Please sign in to comment.