modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 529 forks source link

Duplicate TV has caption "undefined" #13302

Closed mindeffects closed 6 years ago

mindeffects commented 7 years ago

Summary

When duplicating a TV (right-click inside the tree) the new caption is always "Duplicate of undefined" (red box), even if the source has a caption (green box): modx_issue_duplicate-tv (When using the "Duplicate"-button while editing a TV, the new caption field is empty and the is no "undefined" – but still, there is no duplicate of the caption.)

Step to reproduce

Right-click on a TV an choose "Duplicate TV".

Observed behavior

see: summary

Expected behavior

The new caption should show "Duplicate of " with being the caption of the source TV or it should be empty, when there is nothing to duplicate (caption of source is empty)

Environment

On any system, as far as I can say, running 2.5.5. I had this issues also on lower versions but can't recall if it was 2.5.4, 2.5.2 or even lower.

sottwell commented 7 years ago

I can't replicate the issue, Revo 2.5.5 screen shot 2017-02-20 at 11 17 20 screen shot 2017-02-20 at 11 17 40

mindeffects commented 7 years ago

That is strange, @sottwell! I just did a quick check on several 2.5.5 installations. All of them (4) were build from scratch without a boilerplate or so. They all run on different machines and run at different hosters. But all of them had the same "undefined" in the caption field. Anybody else in here who an confirm either behavior?

sottwell commented 7 years ago

What exactly is the full caption of the original TV?

Jako commented 7 years ago

@mindeffects Please look in the DB entry for this. Is the caption null for some reason?

sottwell commented 7 years ago

Behavior is different if I use the Duplicate button with the original TV open for editing, or if I use the Duplicate TV context menu option. In the latter case, it does pre-fill the caption field screen shot 2017-02-20 at 12 10 29

sottwell commented 7 years ago

Since the full caption of the original is covered by the form, I was thinking that perhaps there was something unexpected in the full caption text.

sottwell commented 7 years ago

If the caption is empty, the duplicate will have "Duplicate of " in its caption field.

Also there is a difference in behavior after saving, using the button redirects to the new copy, using the context menu does not.

ant-tar commented 7 years ago

@mindeffects I can confirm that issue for 2.5.4 http://take.ms/3UEa1 This is happens when TV duplicated via right click on Element tree TV ONLY!

mindeffects commented 7 years ago

The content is a string, @Jako, with nothing special in it. Tested several "typed in " words.

When I use the "Duplicate"-button when editing a TV, the caption is always empty, even if the source TV had a caption.

When I use the right-click (forgot to put this in the isse description, EDIT: it was in the "Step to reproduce"), I get the "Duplicate of undefined" or a simple "undefined" in the caption field.

alroniks commented 7 years ago

@mindeffects Did you use some additional extras like AjaxManager or others? Tried on latest 2.5.5 and can not reproduce.

ant-tar commented 7 years ago

@Alroniks @mindeffects Retested right now with 2.5.5. MODX cloud environment (absolutely pure MODX with single test TV), result now is: http://take.ms/P6wX2

alroniks commented 7 years ago

@himurovich Caption field not visible on screenshot but looks that it works, no undefined.

johanmolen commented 7 years ago

I'm going to try and fix this today. #modxbughunt

johanmolen commented 7 years ago

I could not reproduce the "undefined" message.

But once you clicked on the duplicate button within a TV page itself (not in tree) the caption was not prefilled. With this PR it is: https://github.com/modxcms/revolution/pull/13317

Mark-H commented 7 years ago

13317 fixes the issue that the caption isn't pre-filled when duplicating from the edit tv screen, however I'm still seeing undefined when duplicating via the context menu.

flowan commented 7 years ago

@Mark-H I tried to reproduce the wrong caption when duplicating from the context menu, but it works just fine. Can you confirm you still have this issue? Thanks

gpsietzema commented 7 years ago

modxbughunt #1point to @Flowan

wuuti commented 6 years ago

@mindeffects @Mark-H @sottwell I can't reproduce that with current 2.x (2.6.1). Was that fixed by #13317? Can you please try to reproduce that with the current version? Have the feeling this issue might no longer be valid. If the issue still occurs, please also tell the browser used to reproduce.

sottwell commented 6 years ago

Behaves as expected here.

sottwell commented 6 years ago

screen shot 2018-02-12 at 5 33 10

muzzwood commented 6 years ago

screenshot-2018-2-12 template variable closeddatefrom

I'm still experiencing the bug. I created a TV. Saved it. Then with the TV editing form still open I used the context menu in the tree to select duplicate. The result is in the image. MODX 2.6.1 and using Firefox 58

wuuti commented 6 years ago

Is there anything logged in the javascript console?

muzzwood commented 6 years ago

Nope, nothing.

JoshuaLuckers commented 6 years ago

~I’m able to reproduce this issue~. I'm not able to reproduce this issue. I will try to reproduce and fix this issue somewhere in the upcoming days.

alroniks commented 6 years ago

Tries on 2.7.0-dev and all works fine. I close the issue as it seems fixed for most people. The issue can be still there if a cache was not updated or something else. I suggest reopen or open a new one with details in case it will happen again.

JoshuaLuckers commented 6 years ago

I just ran into this issue on a 2.6.5 installation. The issue only occurs when you try to duplicate a Template Variable that is assigned to a category.

@modxbot open

ant-tar commented 6 years ago

Yes,the same thing on 2.6.5

ant-tar commented 6 years ago

For those with no category caption will be partly empty when copying http://take.ms/K2l84f

alroniks commented 6 years ago

Closing as PR is merged.