Search

Hi! I'm using the Image Cropper extension and making some tests with Symphony 2.3.3 in the Integration branch.

This issue Upload Field: File Paths is about saving files without file path, and this breaks the extension Image Cropper.

Can anyone help me fix this? I just need to get the file path with a given field ID. Is this possible?

I think you'll need to get the 'destination' field from the 'symfieldsupload' in the db.

Not sure how to retrieve that other than building an SQL query.

There is '$this->get('destination') in the upload field which has resulted in grabbing the path of the upload field.

Thanks Andrew!

I think the only way is with SQL Query...

Here what work:

$related_field_type = Symphony::Database()->fetch("SELECT type FROM `sym_fields` WHERE id = " . $related_field_id);
$related_field_type = $related_field_type[0]['type'];
$related_destination = Symphony::Database()->fetch("SELECT destination FROM `sym_fields_" . $related_field_type . "` WHERE field_id = " . $related_field_id);
$related_destination = str_replace("/workspace", "", $related_destination[0]['destination']);

First time at this development level in Symphony, if there are better ways to do this, I accept suggestions. =]

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details