diff --git a/_admin.php b/_admin.php index 46d3abc..0d8da43 100644 --- a/_admin.php +++ b/_admin.php @@ -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); diff --git a/_define.php b/_define.php index d8fe0b3..73d30cc 100644 --- a/_define.php +++ b/_define.php @@ -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', diff --git a/_public.php b/_public.php index 994a92d..9146afc 100644 --- a/_public.php +++ b/_public.php @@ -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']; }