Remove Fakeobjects as hard dependency

Created on 4 July 2021, over 3 years ago
Updated 20 May 2024, 7 months ago

Fakeobjects module is a dependency, CKEditor is a dependency of of Fakeobjects. This makes CKEditor a dependency of Footnotes.

That is a pain for sites which do not want CKeditor. We are migrating from a D7 site where Footnotes is in extensive use, and we are very happy with it. However, we do not use CKEditor.

This is especially inconvenient as Fakeobjects is not fully maintained. That is another reason for removing Fakeobjects as a hard depedency.

If CKEditor integration is split into a sub-module, Fakeobjects could be a dependency there. Otherwise, Fakobjects should be optional.

πŸ“Œ Task
Status

Fixed

Version

4.0

Component

Footnotes

Created by

πŸ‡¬πŸ‡§United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom catch
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    run-tests.sh fatal error
  • πŸ‡³πŸ‡±Netherlands mike.vindicate

    Added patch that applies to version 3.1.0 which has support for CKEditor 4 and 5. We probably want to start a whole new version (4) of this module where support is dropped for CKEditor 4. Tweaked some minor things to the requirement, so that it only checks if CKEditor contrib is installed.

    Since changes are made to the info.yml file, you can use this package: https://packagist.org/packages/orakili/composer-drupal-info-file-patch-h.... Then you should be able to install the patch.

  • πŸ‡ΊπŸ‡ΈUnited States fallenturtle

    Patch in #7 is mostly working for me in the sense that I don't have to have the modules installed, but one issue I'm running into is that composer still downloads fakeobjects and ckeditor 4 and won't let me remove them as it says they are a dependency for footnotes. I see that this patch removes them from footnotes composer.json file, so I assume the issue is related to the order composer is doing things? Is there a way I need to restructure my composer.json file or some config I need to do with composer-drupal-info-file-patch-helper?

    Thanks!

  • πŸ‡¬πŸ‡§United Kingdom seogow

    @fallenturtle that is correct.

    Until this dependency is removed as dependency from the composer.json in the footnotes module, it will be required in composer.lock. The workflow is as follows:

    1. Footnotes are installed including their dependencies (fakeobjects).
    2. Patch is applied, removing dependencies from .info (works) and from composer.json (only after they were recorded in central composer.lock).

    AFAIK you have two options:

    1. Use patchless approach; or
    2. Live with the unused modules in code source until the patch is incorporated into the module.

    I hope the above explains the issue :)

  • Status changed to RTBC over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom catch

    It should be possible to apply the patch and also add 'provides' in your root composer.json, see https://getcomposer.org/doc/04-schema.md#provide

    But I think the patch is fine and this could go out in a release. ckeditor4 is nearly EOL.

  • πŸ‡¬πŸ‡§United Kingdom seogow

    @catch (and @fallenturtle) I was thinking about usage of replace, but there are downsides to both approaches:

    • If another module or theme in your Drupal project genuinely needs fakeobjects, it won't get installed because Composer thinks it's already provided.
    • You'll need to manually manage the version in the provides section if the unnecessary dependency's version changes in the original module's composer.json before the patch is applied.

    Thus, since we all agree patch works, I would still suggest to wait for merge or go patchless.

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    As I'm migrating away from Markdown, towards just HTML + CKEditor 5, I was looking for an alternative. This module looks like the strongest candidate. But this is a hard blocker πŸ˜… Would be great if we could drop this CKEditor 4-only dependency πŸ™

    +++ b/footnotes.info.yml
    @@ -2,7 +2,3 @@ name: Footnotes
    -test_dependencies:
    -  - 'fakeobjects:fakeobjects'
    

    Note that this should be kpt, for continuing to test against CKEditor 4!

    We only need to drop the hard dependency in composer.json and dependencies:.

  • πŸ‡¨πŸ‡¦Canada Shiraz Dindar Sooke, BC

    The patch in #7 wouldn't apply to my 3.1.0 release because some of the changes are already rolled in.

    Here it is again with *just* the change to the info file. It applies now and I can disable ckeditor4 along with fakeobjects.

  • πŸ‡¦πŸ‡ΉAustria inst

    Hi Shiraz,
    thank you - I tried footnotes with your patch and it works grat with Ckeditor 5 without the extra dependencies.

    Could this be part of footnotes?

  • πŸ‡«πŸ‡·France erwangel

    Patch #13 worked for me and I was able to enable footnotes without the fakeobjects dependency alerts. Unfortunately composer still downloads fakeobjects and ckeditor4 that are useless to D10.

  • πŸ‡«πŸ‡·France erwangel

    In complement of my previous comment (#15). Although there were no alerts on enabling footnotes, in the drupal modules listing (extend), fakeobjects and ckeditor4 were enabled and and error appeared in the Status report page. It was impossible to uninstall these modules with Drupal's UI but I managed to do it with drush pm:uninstall fakeobjects, ckeditor4 but then a new error appeared in the Status report "Fakeobjects module isn't installed/enabled. Etc."

  • πŸ‡¦πŸ‡ΉAustria inst

    Hi,
    I applied #13 but me too have this error in my status report:

    Fakeobjects module isn't installed/enabled.
    Footnotes module has a dependency on Fakeobjects module. Ensure that Fakeobjects module is enabled and configured.

    Is there a way that we can exclude this via patch? - Footnote seems to work properly.

  • Status changed to Needs work about 1 year ago
  • heddn Nicaragua

    The entries in .install checking for fakeobjects should also be cleaned-up.

  • πŸ‡¬πŸ‡§United Kingdom scott_euser
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    4x branch will no longer support CKE4, so test dependency can also be dropped. Will continue with tests in πŸ“Œ Add test coverage for 4x branch Active as part of the roadmap to a stable 4x ( 🌱 Roadmap to stable 4x branch Active )

  • Status changed to Fixed 12 months ago
  • πŸ‡¬πŸ‡§United Kingdom scott_euser
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Crediting those who helped on this thanks! Further changes are in the 4x branch already so the commit here does not reflect everything + test coverage not changed/fixed yet as noted.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • πŸ‡ΊπŸ‡ΈUnited States fallenturtle

    Does this mean there's no plan to remove the fakeobjects dependency from version 3 and that if we want to use CKeditor 5 we need to use the patches?

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Sorry I don't have the capacity in my free time to maintain 2 versions and 3x has very little test coverage, much harder for me to maintain (this also isn't the only module I maintain). If someone else wants to volunteer for the 3x branch great, but I cannot commit to it myself.

  • πŸ‡«πŸ‡·France erwangel

    Footnotes 4.0 works fine with no dependency to fakeobject. Not sure but, if I noticed well, it (or composer) even removes fakeobjects and Ckeditor 4 while updating from fn3 to 4

Production build 0.71.5 2024