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) {
$rs = $core->meta->getMeta(
'post_expired',
1,
null,
$post_id
);
$rs = $core->meta->getMetadata([
'meta_type' => 'post_expired',
'post_id' => $post_id,
'limit' => 1
]);
if (!$rs->isEmpty()) {
$post_expired = decodePostExpired($rs->meta_id);

View File

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

View File

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