silverstripe-gridfield-betterbuttons icon indicating copy to clipboard operation
silverstripe-gridfield-betterbuttons copied to clipboard

Behavior of the button 'Save and add file(s)'

Open ghost opened this issue 12 years ago • 10 comments

Hi Aaron!

The first thing to tell you that this is a wonderful module. :) Thanks for your work. Maybe I'm wrong, but the behavior of the button 'Save and add file(s)' is not as expected. When I click on that button the record is saved, but I can not continue entering new records without having to back to the list of records. After clicking on that button, if I make any changes to that form I'm editing the same record just saved. I am using the latest version of SilverStripe 3.1 from: https://github.com/silverstripe/silverstripe-cms/tree/3.1 https://github.com/silverstripe/sapphire/tree/3.1

Thanks, Regards, Jose A.

ghost avatar Mar 12 '13 13:03 ghost

That's the correct behavior. "Save and add file(s)" appears when you have an upload field. It's essentially just for clarity. With the standard buttons, it's not clear to the user that he needs to save the record twice (once to get an ID, and a second time to add the files). The UploadField contains text that says you have to save first, but that's easy to miss. Therefore, the option to "save and close" is missing when you have a new record with an UploadField.

unclecheese avatar Mar 12 '13 13:03 unclecheese

In your readme you say: "Save and add another: Create a record, and go right to adding another one, without having to click the back button, and then add again." Then, How I can go adding records without clicking the back button?

Regards, Jose A.

ghost avatar Mar 12 '13 17:03 ghost

I'm not sure I understand the question. The normal workflow is:

Add New Enter data Save Back Add New etc..

With this module, it's:

Add new Enter data Save and add Another Enter Data etc..

unclecheese avatar Mar 12 '13 17:03 unclecheese

I send you some screenshots showing the procedure and the problem. Tell me something about it. Aaron sc1 Aaron sc2 Aaron sc3 Aaron sc4

I want to take the opportunity to make a question out of this topic. Have you tried the latest version of Saphire and CMS (3.1) from github? https://github.com/silverstripe/silverstripe-cms/tree/3.1 https://github.com/silverstripe/sapphire/tree/3.1 In TinyMCE buttons 'Insert Link' and 'Insert Media' have disappeared. Is this normal? Does it happen to you also? Do I need to configure something? sh2

Thanks, Regards, Jose A.

ghost avatar Mar 13 '13 13:03 ghost

Because the record is no longer new, you're now editing the record, not creating a new one, so there's no easy way to know that you started out by adding a new record.

We could add a persistent "New" button to all detail form views that wasn't context dependent.

unclecheese avatar Mar 14 '13 16:03 unclecheese

That would be a very good idea. A 'New' button would greatly improve the process of entering records. :)

You have not said anything about the disappearance of the 'Insert Link' and 'Insert Media' buttons. You do not have installed the latest SS version 3.1 from github?

Sorry if I upset you asking this. But I think you're an expert on SS and you know.

Thanks for everything.

Regards, Jose A.

ghost avatar Mar 14 '13 16:03 ghost

No need to tell me anything about the problem of the buttons 'Insert Link' and 'Insert Media'. I found the lines that cause the problem: framework\view\Requirements.php Line 663 $path = Convert::raw2xml($this->path_for_file($file)); Line 680 $path = Convert::raw2xml($this->path_for_file($file)); If replaced by: $path = $this->path_for_file($file); everything is ok again.

Regards, Jose A.

ghost avatar Mar 14 '13 17:03 ghost

This got me too and I thought I had fixed it ages ago with the setRecord() method. Of course I was wrong.

It doesn't say on my utterly fresh 3.1 instance (rc1) that one must save the record first and as far as the average user is concerned the image IS the record, therefore the button saying "Save and Add Files" simply means save this record and go on to a new one.

I know that's not what you mean, but sadly that's just what it looks like to a real users.

Perhaps what it wanted is

a) A change in text, perhaps "Save this record before adding Images" b) Better still, autosave the record on its creation so that this whole scenario never occurs. How would one do that?

tazzydemon avatar Aug 25 '13 21:08 tazzydemon

Well I just thought I would let you know that this worked and provides a workflow that ownt confuse the average user. Even the fact that it can create empty records without an explicit save is not too confusing. This is from my SlideImage.php class which has a has_many on all page types (from Page.php)

    $imageField =  new UploadField('Image','Choose Images');
    $imageField->setFolderName('Uploads/orbit-slider');
    $imageField->setRecord($this);
    $this->write();

_ Simple and effective and probably contrary to all the purists thinking but it means that your buttons "Save", "Save And..." and "Delete" appear immediately which is what users will expect.

tazzydemon avatar Aug 25 '13 22:08 tazzydemon

Sorry, too simplistic - it sort of works and you get the idea I hope.

tazzydemon avatar Aug 25 '13 22:08 tazzydemon