Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodim99 committed Sep 7, 2017
1 parent 0bd518f commit 989a2fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cms/include/classes/Cetera/DynamicFieldsObject.php
Expand Up @@ -678,11 +678,11 @@ public function delete()
{
// удаление ссылок с удаляемого материала
$r = $this->getDbConnection()->query("select B.name, B.len, B.type, B.pseudo_type from types A, types_fields B where A.alias='".$this->table."' and B.id=A.id and (B.type=".FIELD_LINKSET." or B.type=".FIELD_MATSET.")");
while ($f = $r->fetch()) {
while ($f = $r->fetch(\PDO::FETCH_NUM)) {
$tbl = ObjectDefinition::get_table($f[2], $f[1], $this->objectDefinition->id, $f[3]);
if ($f[2] != FIELD_LINKSET && $f[3] != PSEUDO_FIELD_TAGS) {
$r1 = $this->getDbConnection()->query("select dest from ".$this->table."_".$tbl."_"."$f[0] where id=".$this->id);
while ($f1 = $r1->fetch()) {
$r1 = $this->getDbConnection()->query("select dest from ".$this->table."_".$tbl."_".$f[0]." where id=".$this->id);
while ($f1 = $r1->fetch(\PDO::FETCH_NUM)) {
$m = Material::getById($f1[0], $f[1], $tbl);
$m->delete();
}
Expand Down
2 changes: 1 addition & 1 deletion cms/include/constants.php
Expand Up @@ -11,7 +11,7 @@
**/

/** Версия */
define('VERSION', '3.38.2');
define('VERSION', '3.38.3');

/** Название продукта */
define('APP_NAME', 'Cetera CMS');
Expand Down
7 changes: 4 additions & 3 deletions cms/include/data_tree.php
Expand Up @@ -53,9 +53,10 @@
$where = 'id<>'.$exclude_mat;
if ($_GET['query'])
$where .= ' and name LIKE '.$application->getConn()->quote('%'.$_GET['query'].'%');
$m = $c->getMaterials('name', $where, $matsort, '', 500, 0);
foreach ($m as $material)
{
//$m = $c->getMaterials('name', $where, $matsort, '', 500, 0);
$m = $c->getMaterials()->where($where)->setItemsCountPerPage(500);

foreach ($m as $material) {
$name = htmlspecialchars($material->name);
$name = str_replace("\n",'',$name);
$name = str_replace("\r",'',$name);
Expand Down

0 comments on commit 989a2fe

Please sign in to comment.