Coder Social home page Coder Social logo

Comments (15)

prdt3e avatar prdt3e commented on August 25, 2024 1

we should find a universal solution.
That would be an impertinence for every field and for every extension to add.
@mbrodala what do you mean?

from t3x-rte_ckeditor_image.

muh-nr avatar muh-nr commented on August 25, 2024

Hi @mbrodala,
thanks for your hint.
Not simple to count it down again after removing an image.

Feel free to add a pull request.

from t3x-rte_ckeditor_image.

mbrodala avatar mbrodala commented on August 25, 2024

In fact we have ported the soft reference index from sgalinski/tinymce4-rte and it's working just fine. Adding images (even resized) increases the reference count, removing them again decreases it. The DataHandler takes care of all this but it needs a hint, how many references are in a blob of text.

We'll test this a little longer and if it works fine, I'll add a PR with this. :-)

from t3x-rte_ckeditor_image.

muh-nr avatar muh-nr commented on August 25, 2024

Sounds good. Would be very nice.

from t3x-rte_ckeditor_image.

muh-nr avatar muh-nr commented on August 25, 2024

@mbrodala,
any news on this?

from t3x-rte_ckeditor_image.

mbrodala avatar mbrodala commented on August 25, 2024

I was off for vacation in the last 2 weeks. Our fix seems to work fine, I just need some time to turn it into a PR. I try to do this this week.

from t3x-rte_ckeditor_image.

muh-nr avatar muh-nr commented on August 25, 2024

Hey @mbrodala, I'm still interested!

from t3x-rte_ckeditor_image.

muh-nr avatar muh-nr commented on August 25, 2024

Hi @mbrodala,
I did some cleanups and merged your changes into master via branch issue-45.
I squashed the commits to not have cleanup commits in master.

Please check the current master.

Thanks for your help!

from t3x-rte_ckeditor_image.

mbrodala avatar mbrodala commented on August 25, 2024

Thanks a lot, looking forward to the next release. :-)

from t3x-rte_ckeditor_image.

mbrodala avatar mbrodala commented on August 25, 2024

For the reference: 8005c8b

from t3x-rte_ckeditor_image.

prdt3e avatar prdt3e commented on August 25, 2024

What if the editor is outside of ['tt_content'] ['columns'] ['bodytext']?
New field? News plugin? Own extension?

from t3x-rte_ckeditor_image.

mbrodala avatar mbrodala commented on August 25, 2024

@prdt3e See the related change, you'll need to add a small TCA overrides snippet for your field.

from t3x-rte_ckeditor_image.

prdt3e avatar prdt3e commented on August 25, 2024

The solution can be found here with a loop.
It would then be all fields in tt_content covered.

https://github.com/FriendsOfTYPO3/rtehtmlarea/blob/master/Configuration/TCA/Overrides/tt_content.php

But I'm not happy.

from t3x-rte_ckeditor_image.

sypets avatar sypets commented on August 25, 2024

What is the current status on this?

I tested that a sys_refindex entry gets created when inserting an image in an RTE-field (tt_content.bodytext). This is the case for 9.0.4, but not for 9.0.3 so this looks good.

Is this now fixed in general or does this only work now for some specific fields? (In the patch it looks like the TCA changes are only made for tt_content.bodytext.)

Will updating the reference index also add references for previously inserted images?

from t3x-rte_ckeditor_image.

sypets avatar sypets commented on August 25, 2024

Can you please add the "bug" label? This is a bug. If the reference index is not updated, the references will not be shown in the file list which may result in files being removed (by unsuspecting editors) even though they are still being used.


Current status: Reference index entry is not created with latest master:

  • rte_ckeditor_image: dev-master
  • TYPO3 11.5.25 or dev-11.5

I noticed that what is returned by RteImageSoftReferenceParser::findImageTags is probably wrong.

return [
            'content'  => implode('', $this->splitContentTags),
            'elements' => $images,
        ];

should be:

return $images;

Comparing what is passed to (the core) SoftReferenceParserResult::create function with an rte image tag, the result is wrapped in an extra content / elements array:

  1. with rte image tag

$elements is

content : "<p><img ---"
elements:
  1: 
    matchString":"<img  ..."
    subst: 
     type: "db" 
     recordRef: "sys_file:17804",
     tokenID: "f6f3a30214c2f46e38d28c50e19e65c8"
     tokenValue: "17804"
  1. with file link, it looks more like this:
1: 
   matchString":"<a href=  ..."
   subst: 
    type: "db" 
    recordRef: "sys_file:17804",
    tokenID: "f6f3a30214c2f46e38d28c50e19e65c8"
    tokenValue: "file:17804"

from t3x-rte_ckeditor_image.

Related Issues (20)

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.