Bug #56887

Tagging via Drag-Drop failed

Added by Simon Edelmann over 1 year ago. Updated over 1 year ago.

Status:New Start date:2014-03-13
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-

Description

We have a clean installation of Typo3 Neos 1.0.2. We tried to tag some pictures but we got the error message

Tagging the asset failed.

The problem seems to be that Neos don't get the Asset Identifier from JavaScript. So Neos doesn't know which image to tag.

We've located the problem in this file:

Problem: Line 23 in /Packages/Application/TYPO3.Media/Resources/Public/Scripts/tagging.js

assetIdentifier = $(ui.draggable[0]).parent().data('asset-identifier');

There it refers to this HTML code section:

01 <li class="asset" data-asset-identifier="08adf6aa-5c8d-a91f-8ef8-123d4d82f81b">
02     <a class="neos-thumbnail draggable-asset" title="Edit Image1.jpg" href="http://example.de/neos/management/media/edit?moduleArguments%5Basset%5D%5B__identity%5D=08adf6aa-5c8d-a91f-8ef8-123d4d82f81b">
03         <div class="neos-img-container">
04             <img alt="Image1.jpg" width="189" height="189" src="http://example.de/_Resources/Persistent/29ab2743368e636ae10bd27100fe6dfa87b5eb72/Image1.jpg">
05         </div>
06         <span class="neos-caption">Image1.jpg</span>
07     </a>
08    <a class="neos-thumbnail draggable-asset ui-draggable-dragging" title="Edit Image1.jpg" href="http://example.de/neos/management/media/edit?moduleArguments%5Basset%5D%5B__identity%5D=08adf6aa-5c8d-a91f-8ef8-123d4d82f81b" style="position: absolute; opacity: 0.3; left: 135px; top: 350px;">
09         <div class="neos-img-container">
10             <img alt="Image1.jpg" width="189" height="189" src="http://example.de/_Resources/Persistent/29ab2743368e636ae10bd27100fe6dfa87b5eb72/Image1.jpg">
11         </div>
12         <span class="neos-caption">Image1.jpg</span>
13     </a>
14 </li>

While debugging the JavaScript we realized that $(ui.draggable[0]) points to the <a>-Tag (Line 08), while data('asset-identifier') is on the parent li-Tag (Line 01).
The problem could be solved by adding a .parent() in the JavaScript.

Solution: Line 23 in /Packages/Application/TYPO3.Media/Resources/Public/Scripts/tagging.js

assetIdentifier = $(ui.draggable[0]).parent().data('asset-identifier');

History

#1 Updated by Simon Edelmann over 1 year ago

Sorry, we've some more information:

After tagging many photos we realized that our workaround only works in Thumbnail view, but not in List view.
The original code works in List view, but not in Thumbnail view.

So we've created a new solution working for both views:

New Solution: Line 23 in /Packages/Application/TYPO3.Media/Resources/Public/Scripts/tagging.js

assetIdentifier = $(ui.draggable[0]).closest('[data-asset-identifier]').data('asset-identifier');

Also available in: Atom PDF