Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag and Drop ignores allowedContentTypes and deniedContentTypes #1306

Open
monosize opened this issue Jan 31, 2017 · 6 comments
Open

Drag and Drop ignores allowedContentTypes and deniedContentTypes #1306

monosize opened this issue Jan 31, 2017 · 6 comments

Comments

@monosize
Copy link
Member

@monosize monosize commented Jan 31, 2017

If dragging an element into a flux:grid which has a defined allowedContentTypes or deniedContentTypes, the defintions are ignored and the element is added to the column.

Only a insert over the element wizard checks the valid content type!

<flux:grid.column name="elements">
    <flux:form.variable name="allowedContentTypes" value="fluidcontent_content"/>
    <flux:form.variable name="Fluidcontent" value="{allowedContentTypes: 'Vendor.Extension:ContentElement.html'}"/>
</flux:grid.column>

Idea

  • Insert a missing check in flux for a moved element if it is allowed to move into the column.
  • Extend dropzones with data attributes data-allowed-content-types="fluidcontent_content"or data-denied-content-types="fluidcontent_content" and if needed with data-allowed-fluidcontent="Vendor.Extension:ContentElement.html"
  • Extend all dragable elements with data attributes data-content-type="fluidcontent_content" data-fluidcontent-type="Vendor.Extension:ContentElement.html"
  • Extend DragDrop.js - if Drag Start find all dropzones which not allowed to drop the element and hide them. After Drop reset the dropzones.
  • Changing the DragDrop.js would be easier with the new DragDrop.js form the TYPO3 8 branch
@BenjaminBeck

This comment has been minimized.

Copy link
Contributor

@BenjaminBeck BenjaminBeck commented Mar 25, 2017

Hi @monosize
i saw this related ticket on forge: https://forge.typo3.org/issues/7459

@ogrosko

This comment has been minimized.

Copy link
Contributor

@ogrosko ogrosko commented Oct 19, 2017

Do you have any idea how to fix this issue, at least temporarily

@ogrosko

This comment has been minimized.

Copy link
Contributor

@ogrosko ogrosko commented Jan 3, 2018

I'm trying to fix this issue by following hook

For now it works for content inserted to page columns. You will get error and element is not moved/copied to denied page colPos

But I have no idea how to fix it for Flux grid. When I use any hook colPos of moved element is always different e.g.:

array(1) {
  ["tt_content"]=>
  array(1) {
    [25]=>
    array(2) {
      ["colPos"]=>
      string(5) "20450"
      ["sys_language_uid"]=>
      string(1) "0"
    }
  }
}

colPos is still different for each page load and grid column, but in database it is always colPos = 18181

Place where I stuck is here. At this place I would need to know tx_flux_parent and tx_flux_column fields value of modified tt_content record.

Any ideas where is set colPos for element placed in gridelement? Or What kind of hook would I need?
Thx

@ogrosko

This comment has been minimized.

Copy link
Contributor

@ogrosko ogrosko commented Jan 8, 2018

Check this prototyped plugin

UPDATE: drag&drop, copy/move should work now

@FluidTYPO3 FluidTYPO3 deleted a comment from deerfish Jan 11, 2018
@ogrosko

This comment has been minimized.

Copy link
Contributor

@ogrosko ogrosko commented Jan 12, 2018

I've noticed that column variable allowed/disallowedContentTypes is inherited to subpages.
Eg.
I have Default.html page template with defined <flux:form.variable name="allowedContentTypes" value="textpic"/>
And some subpage with Subpage.html page template with definded <flux:form.variable name="allowedContentTypes" value="list"/>

In Subpage.html content wizard both elements are available textpic and list. I would expect only list element available in Subpage.html. Is it possible to disable this inheritance?

@ogrosko

This comment has been minimized.

Copy link
Contributor

@ogrosko ogrosko commented May 2, 2018

Feel free to test dw-content-protector extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.