Melbourne
Account created on 22 March 2011, over 13 years ago
#

Recent comments

🇦🇺Australia stephenrodrigo@yahoo.com Melbourne

The, problem for this is the ARGS column in the draggableviews_structure table. In Draggable views 8.X versions, the arguments were saved in the ARGS column. Therefore, sorting were based on arguments of the URLs. This was working perfectly with Drupal 7.

When you inspect the draggableviews_views_submit hook. You will see the $view_args will be set from $view->args
$view_args = !empty($view->args) ? json_encode($view->args) : '[]'

But, this is wrong, $view_args should be set from the exposed filters.

I

🇦🇺Australia stephenrodrigo@yahoo.com Melbourne

I agree with @solideogloria.

Here is a good article how to remove the metadata in PDFs.
Removing metadata from PDF files using Exiftool and qpdf

I am actually using this in file_pre_save hook

function xxx_file_presave($file) {
  // only proceed with pdf
  if ( !isset($file->filemime) || !preg_match('/pdf/', $file->filemime) ) {
    return;
  }

  $tmpfilename = 'private://' . drupal_random_key();
  $file_realpath = drupal_realpath($file->uri);
  $tmpfilename_realpath = drupal_realpath($tmpfilename);
  try {
    copy($file_realpath, $tmpfilename_realpath);
    $a = `exiftool -all:all= $tmpfilename_realpath`;
    $b = `qpdf --linearize $tmpfilename_realpath ${tmpfilename_realpath}_linear`;
    $c = `exiftool -all:all= ${tmpfilename_realpath}_linear`;
    $d = `qpdf --linearize ${tmpfilename_realpath}_linear ${tmpfilename_realpath}_linear_cleaned_linear`;
    copy("${tmpfilename_realpath}_linear_cleaned_linear", $file_realpath);

    drupal_set_message(t('PDF metadata cleaned for @filename.', array('@filename' => $file->filename)));
  } catch (\Exception $e) {
    watchdog(WATCHDOG_ERROR, 'PDF metadata cleaning failed for @filename.', array('@filename' => $file->filename));
    watchdog(WATCHDOG_DEBUG, $e->getMessage());
  }
}
Production build 0.71.5 2024