Open only1chunts opened 4 months ago
@rija I see this error also in the dataset view (no mockup), I traced it back to the cookies not being updated, despite the correct arguments passed to the controller in the function protected/components/DatasetPageSettings.php
This is the function that takes care of this
public function setFileSettings(array $columns, int $pageSize, CMap $cookies): array
{
if (isset($cookies['file_setting'])) {
$cookies['file_setting']->value = json_encode([ "setting" => $columns, "page" => $pageSize]);
} else {
$cookie = new CHttpCookie('file_setting', json_encode(array('setting' => $columns, 'page' => $pageSize)));
$cookie->expire = time() + (60 * 60 * 24 * 30);
$cookies['file_setting'] = $cookie;
}
return [ "columns" => $columns, "pageSize" => $pageSize ];
}
If I get rid of the conditional and the true branch, the cookie is updated, i.e.:
public function setFileSettings(array $columns, int $pageSize, CMap $cookies): array
{
$cookie = new CHttpCookie('file_setting', json_encode(array('setting' => $columns, 'page' => $pageSize)));
$cookie->expire = time() + (60 * 60 * 24 * 30);
$cookies['file_setting'] = $cookie;
return [ "columns" => $columns, "pageSize" => $pageSize ];
}
Does this looks like an correct fix? I don't find in the Yii docs a method to update cookies like the one in the true branch
NOTE: I will assume the above is correct and create a PR
@only1chunts @rija I see another issue which in principle seems unrelated to this one (happens in develop branch):
Upon refreshing the dataset page, e.g. http://gigadb.gigasciencejournal.com/dataset/view/id/100245 I always see an alert popup "Confirm Form Resubmission":
User story
Acceptance criteria
Additional Info
It happens when change the table settings to also add additional columns (Format, release date) in addition to the nb of items per page
Product Backlog Item Ready Checklist
Product Backlog Item Done Checklist