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

[BUG] @typo3/backend/tree/page-tree-element does not work in BE-Modules #4165

Closed
Tracked by #3995
dkd-kaehm opened this issue Sep 24, 2024 · 0 comments · Fixed by #4167
Closed
Tracked by #3995

[BUG] @typo3/backend/tree/page-tree-element does not work in BE-Modules #4165

dkd-kaehm opened this issue Sep 24, 2024 · 0 comments · Fixed by #4167

Comments

@dkd-kaehm
Copy link
Collaborator

dkd-kaehm commented Sep 24, 2024

BE-Modules produce the BE-Links with strange id parameter, which leads to exceptions.
typo3/module/searchbackend/index-administration?id=0_1_500_501

How to reproduce:

  1. Chose some EXT:solr BE-module
  2. chose some page in tree
  3. switch to another EXT:solr BE-modules, or other page in tree and again to EXT:solr BE-modules
  4. See the error in Browser-dev-tools->Console
    Uncaught (in promise) SyntaxError: identifier must be of type string 
    at ModuleStateStorage.update @_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/storage/module-state-storage.js?bust=1727170979:13:128 (real file: typo3/cms-backend/Resources/PublicJavaScript/storage/module-state-storage.js)
    at ImmediateActionElement.connectedCallback @_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/element/immediate-action-element.js?bust=1727170979:13:1624 (real file: typo3/cms-backend/Resources/PublicJavaScript/element/immediate-action-element.js) 
    
  5. Switch to some Core Module with page-tree, the PID is not chosen as well.
    Chosing other page in tree solves the issue.

Source of trouble:

EXT:solr module do not provide module infos(identifier) in response, so the processing in

https://github.com/TYPO3/typo3/blob/0d6b6e7f9cf70058a6b8a8f7f2c903f69618f30e/Build/Sources/TypeScript/backend/storage/module-state-storage.ts#L43

  public static update(module: string, identifier: string|number, selected: boolean, mount?: string|number)
  {
    if (typeof identifier === 'number') {
      identifier = identifier.toString(10);
    } else if (typeof identifier !== 'string') {
      throw new SyntaxError('identifier must be of type string'); // <- Here stops the processing
    }
    if (typeof mount === 'number') {
      mount = mount.toString(10);
    } else if (typeof mount !== 'string' && typeof mount !== 'undefined' && mount !== null) {
      throw new SyntaxError('mount must be of type string');
    }
    const state = ModuleStateStorage.assignProperties(
      { mount, identifier, selected } as StateChange,
      ModuleStateStorage.fetch(module)
    );
    ModuleStateStorage.commit(module, state);
  }

Current workaround: Chose desired page in tree again to get int UID again in address-bar


TYPO3 Core issues:

dkd-kaehm added a commit to dkd-kaehm/ext-solr that referenced this issue Sep 24, 2024
…Modules

This change fixes the strange behavior by switching BE-modules and/or page in page-tree.
It depends on following TYPO3 core issues:
* https://forge.typo3.org/issues/103784
* https://forge.typo3.org/issues/104457


Fixes: TYPO3-Solr#4165
Relates: TYPO3-Solr#3995
dkd-kaehm added a commit to dkd-kaehm/ext-solr that referenced this issue Sep 24, 2024
…Modules

This change fixes the strange behavior by switching BE-modules and/or page in page-tree.
It depends on following TYPO3 core issues:
* https://forge.typo3.org/issues/103784
* https://forge.typo3.org/issues/104457


Fixes: TYPO3-Solr#4165
Relates: TYPO3-Solr#3995
dkd-kaehm added a commit to dkd-kaehm/ext-solr that referenced this issue Sep 25, 2024
…Modules

This change fixes the strange behavior by switching BE-modules and/or page in page-tree.
It depends on following TYPO3 core issues:
* https://forge.typo3.org/issues/103784
* https://forge.typo3.org/issues/104457


Fixes: TYPO3-Solr#4165
Relates: TYPO3-Solr#3995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant