? No Code Attached Yet
avatar phunsoft
phunsoft
31 Jan 2022

Steps to reproduce the issue

  1. Write and save an article. Backend or frontend diesn't matter for this step
  2. Edit the article in the backend. DON'T save yet.
  3. Hit "Preview" button.

Expected result

The preview should show the changed article, despite the fact the changes haeve not been saved yet.

Actual result

The preview shows the last saved state of the article

System information (as much as possible)

Joomla 4.0.6
Linux 3.10.0-1160.49.1.el7.x86_64 #1 SMP
Template: Cassiopeia

Additional comments

avatar phunsoft phunsoft - open - 31 Jan 2022
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jan 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 31 Jan 2022
avatar niharikamahajan02
niharikamahajan02 - comment - 31 Jan 2022

I think it's better to save the article before clicking preview button.

avatar phunsoft
phunsoft - comment - 31 Jan 2022

Yes, this is what I see. But what is the purpose of the preview when I
need to save first?

For me "preview" means I can verify the changes before saving, so that
the public would not see it yet. This is how preview works on (most)
forums.
If a "save" is required for "preview" to work, "preview" is useless.

Am 31.01.2022 um 15:04 schrieb niharikamahajan02:

We need to click on the save button first ,after that by clicking
preview button changes are visible.


Reply to this email directly, view it on GitHub
#36901 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASCXSIKJMHG43YEGY7B5HQTUY2JGPANCNFSM5NGI2BCA.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID:
@.***>

avatar richard67
richard67 - comment - 31 Jan 2022

If a "save" is required for "preview" to work, "preview" is useless.

@phunsoft You can save the article with unpublished state so people visiting cannot see it, but in the preview you can. I would not call this useless.

avatar brianteeman
brianteeman - comment - 31 Jan 2022

@richard67 you can only do that if you are also logged in at the front end with permissions set to view unpublished articles

avatar richard67
richard67 - comment - 31 Jan 2022

@brianteeman I see ... not very comfortable, it seems. So this is a valid issue? But technically I have problems to imagine how we could show a preview without the article having been saved.

avatar brianteeman
brianteeman - comment - 31 Jan 2022

Its a valid issue for me. Have the same problem obviously with the accessibility checker. @roland-d did try to resolve this before but it didnt complete

avatar niharikamahajan02
niharikamahajan02 - comment - 31 Jan 2022

@brianteeman I see ... not very comfortable, it seems. So this is a valid issue? But technically I have problems to imagine how we could show a preview without the article having been saved.

yes that was a point I was also thinking about.

avatar niharikamahajan02
niharikamahajan02 - comment - 31 Jan 2022

Is having a save as copy button going to help?

avatar richard67
richard67 - comment - 31 Jan 2022

Well, that I can't imagine how it can be done doesn't mean it can't be done.

Save as copy won't help here.

avatar niharikamahajan02
niharikamahajan02 - comment - 31 Jan 2022

Ohkk . If it is a valid issue , I would think of a way to solve it then .

avatar phunsoft
phunsoft - comment - 31 Jan 2022

If a "save" is required for "preview" to work, "preview" is useless.

@phunsoft You can save the article with unpublished state so people visiting cannot see it, but in the preview you can. I would not call this useless.

Well, if I unpublish the article, it becomes invisible to the public. I don't want to unpublish a published article, be it only temporaily. The odds will be a user needs this very information just at this point in time.

If it is not possible to implement a real preview with reasonable effort, then the preview button should be removed. Still better than what we have now. IMHO.

avatar phunsoft
phunsoft - comment - 31 Jan 2022

Is having a save as copy button going to help?

Even more clumsy. I'd need to publish in some category only the editor has access to, look at the article, and if ok, change the category, unpublish the old article, then rename the new one, and finally modify menu entries.

avatar simbus82
simbus82 - comment - 1 Feb 2022

If a "save" is required for "preview" to work, "preview" is useless.

I understand very well what the OP says, and it's right. Do you ever used the preview tab here in Github?

image

This is what a "preview" has to do. I need a preview BEFORE saving. But in Joomla we can use versioning to obtain this, but semantically and from UX side the "preview" in Joomla is simply wrong.

avatar brianteeman
brianteeman - comment - 1 Feb 2022

But in Joomla we can use versioning to obtain this,

No you cant

avatar brianteeman
brianteeman - comment - 1 Feb 2022

. Do you ever used the preview tab here in Github?

Not really comparable

avatar simbus82
simbus82 - comment - 1 Feb 2022

@brianteeman, I think you didn't understand.

It is objective that the Joomla preview is a "fake preview" compared to any other system that includes some preview logic (and the Github example is striking, I see what will be rendered without saving anything).

I said that it can be done with versioning, on the user side: it's a fact that users uses the preview as a tool to "evaluate" whether what will be edited (not saved), will be correct or not.
With versioning I can go back after an edit, so in the absence of a real preview I can save a version, check the preview, and if I don't like it, go back to the previous version. This is exactly what the preview function should do, show something real BEFORE saving.

I was just providing a workaround for the end user, defending a conceptual error of the Joomla preview.
I didn't say that "at the development level" versioning is good for something to technically improve the preview.

avatar dgrammatiko
dgrammatiko - comment - 1 Feb 2022

But technically I have problems to imagine how we could show a preview without the article having been saved.

it's totally viable:

  • get the FormData from the current form
  • validate the data, if not valid return an error message
  • POST the data as JSON to the a new (the code that needs to be written) controller function
  • do a server side validation of the data and if ok then pass the data to the model and then the view

That should enable previews for non saved forms

caveats: The link IS NOT shareable as it's a POST and the data is passed as JSON...

BTW if the controller function is in place the versioning could also be done as rendered diffs instead of the funky form diff...

avatar phunsoft
phunsoft - comment - 2 Feb 2022

Am 01.02.2022 um 22:40 schrieb Dimitris Grammatikogiannis:

       caveats: The link IS NOT shareable as it's a POST and the data
is passed as JSON...
The current preview opens a "popup" in the current window, and is not
showing an address field. So the (temporary) link is not seen, and
cannot be copied.

avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: ?
avatar Hackwar Hackwar - labeled - 17 Feb 2023

Add a Comment

Login with GitHub to post a comment