Unable to edit image details from upload field

silverstripe-4
Tags: #<Tag:0x00007f10c6f75368>

#1

Silverstripe Version: 4.4

Question:

I have a many-to-many relationship between Page and Image, with additional fields on the link table (as part of a sorting module).

When I upload images, I get the usual thumbnail and details, with the “DRAFT” label, as expected. However, I also have the image focus add-on enabled to help with cropping, so I would like to edit the file at the time of the upload.

This is my upload field:

But if I click on the View button, all the fields are disabled so I can’t change any of them, not even after saving the page (and in turn, publishing the image).
image

If I go to the file manager, I can edit it fine. But is there a way to edit this here at the time of uploading? I’m sure I could do this elsewhere, so not sure if the relationship (many-to-many) is causing an issue?

Any help appreciated, as always!

Just for reference:

Page.php

    private static $has_one = [
        'HeaderImage'   => Image::class
    ];

    private static $many_many = [
        'Slides' => Image::class
    ];

    private static $owns = [
        'Slides'
    ];

    // this adds the SortOrder field to the relation table.
    // Please note that the key (in this case 'Slides')
    // has to be the same key as in the $many_many definition!
    private static $many_many_extraFields = [
        'Slides' => ['SortOrder' => 'Int']
    ];

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        // Slides
        $fields->addFieldToTab('Root.Header', SortableUploadField::create('Slides', 'Slides'));

        return $fields;
    }

mysite.yml

---
Name: myproject
---
SilverStripe\Core\Manifest\ModuleManifest:
  project: app
SilverStripe\Assets\Image:
  belongs_many_many:
    Pages: Page.Slides

#2

Hi @Parker1090 this is a known issue: Can't edit focus point outside of Files section · Issue #53 · jonom/silverstripe-focuspoint · GitHub

Unfortunately in the popup Files dialogue in SS4 no details are editable currently, including the FocusPoint. It’s a particularly sucky UX for FocusPoint because you can’t tell the field is disabled. I haven’t had time to make a fix and I was hoping the ability to edit files in that interface would be restored at some point (so then it would be a non-issue), but it hasn’t happened yet.

Pull requests welcome!


#3

Ah, that makes sense!

I notice it’s flagged as potentially being related to Having to "Edit Original File" is unintuitive compared to SS3 inline editing · Issue #813 · silverstripe/silverstripe-asset-admin · GitHub, so given this has been moved to high impact just over a week ago, :crossed_fingers: this may cascade down and fix the issue with this add-on too.

If my skill set went as far as being able to fix things like this, I’d happily submit a PR!