The Sorting feature doesn't work right now, since the save function contains a typo.
The Error is found at line 277 in PhotosRearrangeController.php.
The function condition() is called wrong: condtion('pid', $nid)
public function editSortSave($order = [], $nid = 0, $type = 'images') {
if ($nid) {
$access = FALSE;
if ($nid) {
$node = \Drupal::entityManager()->getStorage('node')->load($nid);
// Check for node_accss.
$access = _photos_access('editAlbum', $node);
}
if ($access) {
$weight = 0;
// Update weight for all images in array / album.
$db = \Drupal::database();
foreach ($order as $image_id) {
$fid = str_replace('photos_', '', $image_id);
if ($type == 'images') {
// Save sort order for images in album.
$db->update('photos_image')
->fields([
'wid' => $weight,
])
->condition('fid', $fid)
->condtion('pid', $nid)
->execute();
}
$weight++;
}
if ($weight > 0) {
$message = t('Image order saved!');
return $message;
}
}
}
}
After fixing the typo, the save will work again.
Comments
Comment #3
nathaniel commentedThanks for the bug report!