fix metadata call

This commit is contained in:
Jean-Christian Paul Denis 2021-08-20 23:35:03 +02:00
parent e7a3cb0fa1
commit 91cbf257dd
3 changed files with 9 additions and 10 deletions

View File

@ -332,12 +332,11 @@ class adminBehaviorPostExpired
if ($post_id) { if ($post_id) {
$rs = $core->meta->getMeta( $rs = $core->meta->getMetadata([
'post_expired', 'meta_type' => 'post_expired',
1, 'post_id' => $post_id,
null, 'limit' => 1
$post_id ]);
);
if (!$rs->isEmpty()) { if (!$rs->isEmpty()) {
$post_expired = decodePostExpired($rs->meta_id); $post_expired = decodePostExpired($rs->meta_id);

View File

@ -19,7 +19,7 @@ $this->registerModule(
'Expired entries', 'Expired entries',
'Change entries options at a given date', 'Change entries options at a given date',
'Jean-Christian Denis and Contributors', 'Jean-Christian Denis and Contributors',
'2021.08.19', '2021.08.20',
[ [
'permissions' => 'usage,contentadmin', 'permissions' => 'usage,contentadmin',
'type' => 'plugin', 'type' => 'plugin',

View File

@ -182,17 +182,17 @@ class rsExtPostExpiredPublic extends rsExtPost
public static function postExpiredDate(record $rs) public static function postExpiredDate(record $rs)
{ {
if (!$rs->postexpired[$rs->post_id]) { //memory if (!$rs->postexpired[$rs->post_id]) { //memory
$rs_date = $rs->core->meta->getMetadata(array( $rs_date = $rs->core->meta->getMetadata([
'meta_type' => 'post_expired', 'meta_type' => 'post_expired',
'post_id'=> $rs->post_id, 'post_id'=> $rs->post_id,
'limit'=> 1 'limit'=> 1
)); ]);
if ($rs_date->isEmpty()) { if ($rs_date->isEmpty()) {
return null; return null;
} }
$v = unserialize(base64_decode($rs_date->meta_id)); $v = decodePostExpired($rs_date->meta_id);
$rs->postexpired[$rs->post_id] = $v['date']; $rs->postexpired[$rs->post_id] = $v['date'];
} }