GithubHelp home page GithubHelp logo

kephson / paste_reference Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 16.0 2.83 MB

Paste reference instead of copy for content elements in TYPO3

License: MIT License

PHP 82.53% JavaScript 5.17% CSS 12.30%
extension hacktoberfest

paste_reference's People

Contributors

kephson avatar mvoehringer avatar sbuerk avatar simonschaufi avatar spoonerweb avatar taieb123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

paste_reference's Issues

[BUG] Drag&droping container children from one column to the other returns error

Summary / Description

Moving children of a multicolumn container from one column to another loses colPos and returns error.

Response to the ajax call is :
{"redirect":"","messages":[{"title":"","message":"1: These fields of record 9554 in table \u0022tt_content\u0022 have not been saved correctly: colPos! The values might have changed due to type casting of the database.","severity":2}],"hasErrors":true}

Possibly the same issue as #6 and b13/container#297
This is said to be fixed for versions>=2.0.1, but not for Typo3 10 compatible versions.

Version

Tested versions
EXT:paste_reference 1.0.2
EXT: container 2.1.1, 2.1.0
TYPO3: 10.4.31

Steps to reproduce

Add a sample multicolumn container to a page and add child elements. Try moving child elements from one column to another by drag&droping.

[BUG] Something does not work properly

Summary / Description

The modal header shows an undefined in place of the content element title

Version

2.0.3

Steps to reproduce

Just copy a content element and then click on the button to paste content it will show you undefined as the title.

Expected behavior

It should show you the title of copied content or in place show us a message "no title".

Actual behavior

Show undefined.

Additional

Possible fix
I solved this issue using the declared typo3 attribute that contains the correct data.

Insert button not working in Typo3 11

Summary / Description

In Typo3 11, when you click the insert button (button with arrow) in page view and choose a content element, nothing happens.

Version

2.0.1

Steps to reproduce

In Typo3 11, when you click the insert button (button with arrow) in page view and choose a content element, nothing happens.

Expected behaviour

Dialog to copy or insert reference.

Actual behavior

Nothing happens.

Additional

Possible fix

paste_reference/Resources/Public/JavaScript/PasteReferenceOnReady.js line 145 ff uses setFormValueFromBrowseWin, which does not exist in Typo3 11. Replace with:
require(['TYPO3/CMS/Backend/Utility/MessageUtility'], function (MessageUtility) {
window.addEventListener('message', function (e) {
etc

Miscellaneous

[BUG] Custom CSS still required?

Summary / Description

The included CSS Skin t3skin_override.css seems to be related to TYPO3 v11 instances. It e.g. adds a grey background to the header of a content element on hover, which in v12 does not suit into the layout of the page module.

Version

Main branch

Expected behaviour

Page module layout does not change

Actual behavior

Page module layout changes and looks broken (e.g. on hover of a content element)

Additional

I removed the CSS and the extension was still working, so I guess, the CSS is not needed any more.

[BUG] Translation of references

Summary / Description

Translation of Reference is not working. It will reference the initial language

Version

2.0.0

Steps to reproduce

past as reference a translated record

Expected behaviour

show the translated record

Actual behavior

it will show the origin language

[BUG] Change Datahandler Call when Moving Elements with Drag&Drop

Summary / Description

do not mix data and cmd in PasteReferenceDragAndDrop JS

the PasteReferenceDragAndDrop JS uses a mix of data and cmd when moving elements like

data = [
    'tt_content' => [
        'colPos' => 10,
        'sys_language_uid' => 0
    ]
];
cmd = [
    'tt_content' => [
        1 => ['move' => 139]
    ]
];

this leads to multiple Workspace Bugs (https://forge.typo3.org/issues/92849)
core has removed this mix
https://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/c1be5540b20421fdfa295a1323b663f3189a41d7

mixing cmd and data has also dropped from EXT:container 2.0, and this leads to b13/container#297

the EXT:paste_reference datahandler call in the JS should change to:

data = null;
cmd = [
  'tt_content' => [
      1 => [
          'move' => [
              'action' => 'paste',
              'target' => 139,
              'update' => [
                  'colPos' => 10,
                  'sys_language_uid' => 0
              ]
          ]
      ]
  ]
];

i will provide an PR

ShortcutPreviewRenderer should also show time controlled references that are currently not visible

Hi,

The preview renderer for shortcuts filters out time controlled references that are currently not visible. This is a bit confusing for editors, since they might think that the element does not work. Thus i'd like to remove the restrictions for StartTime and EndTime. Do you agree? Then i will prepare a pull request

--> \EHAERER\PasteReference\PageLayoutView\ShortcutPreviewRenderer::collectContentData

$queryBuilder = $this->getQueryBuilder();
$queryBuilder->getRestrictions()->removeByType(\TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction::class);
$queryBuilder->getRestrictions()->removeByType(\TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction::class);

References not working with EXT:container

          I have installed EXT:container. 

In a two column container element i have a header element. When i use "Paste after as reference", then the new reference is created as an "unused element" and not in the container after the header element.
Bildschirmfoto 2024-01-29 um 14 21 24

Payload paste reference after
Bildschirmfoto 2024-01-29 um 14 35 30

Payload copy after
Bildschirmfoto 2024-01-29 um 14 35 20

Originally posted by @christophlehmann in #21 (comment)

[BUG] Issue with the top.rawurlencode

Summary / Description

Option from the context menu pastes reference after are not working.

Version

Version 2.0.2

Steps to reproduce

Paste content using the option paste reference after In the context menu.

Expected behavior

Show an error on the console Navigator, and the functionality is not working.

Actual behavior

Functionality not working.

Additional

Possible fix

I found this as typo3 deprecation and now we can use the encodeURIComponent instead of top.rawurlencode()

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/10.0/Deprecation-88428-ToprawurlencodeAndTopstr_replace.html

[BUG] TYPO3_REQUEST not available in CLI context (TYPO3 12)

Summary / Description

The global variable TYPO3_REQUEST is accessed without checking the existence.
After that the request ist used to retrieve the query parameters.

Within the CLI context this leads to the exception:
Call to a member function getQueryParams() on null

See: Classes/DataHandler/ProcessCmdmap.php

Version

development branch for TYPO3 12

Steps to reproduce

Expected behaviour

The command map should not be executed.

Actual behavior

The CLI command will leads to an exception.

Additional

Possible fix

Check if the server request is available or stop processing

$request = $GLOBALS['TYPO3_REQUEST'] ?? null;
if (!($request instanceof ServerRequestInterface)) {
           return;
}
$queryParams = $request->getQueryParams();

[BUG] Inserting an Ref does not work

Summary / Description

Insert an Ref does not work

Version

2.0.4
11.5.24

Additional

Console:

Uncaught TypeError: $closestElementWithLanguage.data is not a function
    at DragDrop.default.onDrop (PasteReferenceDragDrop.js?bust=1678439888:190:59)
    at PasteReferenceOnReady.js?bust=1678439888:169:26
DragDrop.default.onDrop @ PasteReferenceDragDrop.js?bust=1678439888:190
(anonym) @ PasteReferenceOnReady.js?bust=1678439888:169
postMessage (async)
send @ MessageUtility.js?bust=1678439888:13
addElement @ ElementBrowser.js?bust=1678439888:13
insertElement @ ElementBrowser.js?bust=1678439888:13
(anonym) @ BrowseDatabase.js?bust=1678439888:13
(anonym) @ RegularEvent.js?bust=1678439888:13

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.