joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.73k stars 3.64k forks source link

Preview does not show changes in article, unless the changes were saved before #36901

Open phunsoft opened 2 years ago

phunsoft commented 2 years ago

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

niharikamahajan02 commented 2 years ago

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

phunsoft commented 2 years ago

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 https://github.com/joomla/joomla-cms/issues/36901#issuecomment-1025770996, 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: @.***>

richard67 commented 2 years ago

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.

brianteeman commented 2 years ago

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

richard67 commented 2 years ago

@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.

brianteeman commented 2 years ago

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

niharikamahajan02 commented 2 years ago

@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.

niharikamahajan02 commented 2 years ago

Is having a save as copy button going to help?

richard67 commented 2 years ago

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.

niharikamahajan02 commented 2 years ago

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

phunsoft commented 2 years ago

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.

phunsoft commented 2 years ago

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.

simbus82 commented 2 years ago

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.

brianteeman commented 2 years ago

But in Joomla we can use versioning to obtain this,

No you cant

brianteeman commented 2 years ago

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

Not really comparable

simbus82 commented 2 years ago

@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.

dgrammatiko commented 2 years ago

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

it's totally viable:

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...

phunsoft commented 2 years ago

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.