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]: logTab is not a constructor when accessing Datahub Config #344

Closed
sessterling opened this issue Jul 10, 2023 · 10 comments
Closed

[Bug]: logTab is not a constructor when accessing Datahub Config #344

sessterling opened this issue Jul 10, 2023 · 10 comments
Assignees
Labels
Milestone

Comments

@sessterling
Copy link

sessterling commented Jul 10, 2023

Expected behavior

When a "Data Object Importer" configuration is created, an interface is displayed to configure it.

Actual behavior

When creating a "Data Object Importer" configuration, the screen remains blank.

I receive the error "Uncaught TypeError: pimcore.plugin.pimcoreDataImporterBundle.configuration.components.logTab is not a constructor" when trying to access the Datahub Config window.

Capture d’écran du 2023-07-10 12-02-21

The Datahub Config window is then stuck and is not interactive

Capture d’écran du 2023-07-10 12-04-46

Steps to reproduce

Install Pimcore Version: v11.0.3

Install Datahub

Install Data Importer

@fashxp
Copy link
Member

fashxp commented Jul 10, 2023

Eventually application logger is not installed/activated.
Should be done automatically though during install

@sessterling
Copy link
Author

I enable the PimcoreApplicationLoggerBundle in my bundle.php

`<?php

use Pimcore\Bundle\ApplicationLoggerBundle\PimcoreApplicationLoggerBundle;

return [
PimcoreApplicationLoggerBundle::class => ['all' => true]
]
`
the package was already installed

Capture d’écran du 2023-07-10 14-31-04

@robertSt7 robertSt7 self-assigned this Jul 13, 2023
@robertSt7
Copy link
Contributor

@sessterling Hi, sorry I am only able to reproduce the bug when I uninstall PimcoreApplicationLoggerBundle. Could you please try to re-install the bundle? Thanks

@sessterling
Copy link
Author

sessterling commented Jul 17, 2023

@robertSt7 Hi, i unistall PimcoreApplicationLoggerBundle (bin/console pimcore:bundle:uninstall PimcoreApplicationLoggerBundle) and install again (bin/console pimcore:bundle:install PimcoreApplicationLoggerBundle) but the error is still present

I also have this error when i login

Capture d’écran du 2023-07-17 09-15-15

@dvesh3 dvesh3 transferred this issue from pimcore/data-hub Jul 18, 2023
@dvesh3
Copy link
Contributor

dvesh3 commented Jul 18, 2023

@robertSt7 please check if the dependent (ApplicationLogger) bundle is properly installed and registered here.

@robertSt7
Copy link
Contributor

@sessterling Hi, sorry, but we are closing the issue as we are not able to reproduce it. Please feel free to open it again if you have a reproducible case. Thanks for your understanding

@sessterling
Copy link
Author

For people who have the same problem, the solution is to first import PimcoreApplicationLoggerBundle, then PimcoreDataHubBundle in config\bundles.php.

`<?php

use Pimcore\Bundle\DataHubBundle\PimcoreDataHubBundle;
use Pimcore\Bundle\DataImporterBundle\PimcoreDataImporterBundle;
use Pimcore\Bundle\ApplicationLoggerBundle\PimcoreApplicationLoggerBundle;

return [
Pimcore\Bundle\SimpleBackendSearchBundle\PimcoreSimpleBackendSearchBundle::class => ['all' => true],
Pimcore\Bundle\TinymceBundle\PimcoreTinymceBundle::class => ['all' => true],
PimcoreApplicationLoggerBundle::class => ['all' => true],
PimcoreDataHubBundle::class => ['all' => true],
PimcoreDataImporterBundle::class => ['all' => true]
];
`

@wujku
Copy link

wujku commented Aug 28, 2023

The problem also happened to me.

I did not register the PimcoreApplicationLoggerBundle package in the config/bundles.php file, because it is loaded in PimcoreDataImporterBundle::registerDependentBundles by default.

<?php

use Pimcore\Bundle\DataHubBundle\PimcoreDataHubBundle;
use Pimcore\Bundle\DataImporterBundle\PimcoreDataImporterBundle;

return [
    PimcoreDataHubBundle::class => ['all' => true],
    PimcoreDataImporterBundle::class => ['all' => true],
];

Unfortunately, because loading priority has not been defined for PimcoreApplicationLoggerBundle as second parameter of addBundle method, PimcoreApplicationLoggerBundle is loaded after PimcoreDataImporterBundle.

Error Uncaught TypeError: Cannot read properties of undefined (reading 'applicationlogger') is a consequence of js libraries concatenation order for Pimcore script-proxy file.

https://github.com/pimcore/data-importer/blob/1.8/src/PimcoreDataImporterBundle.php#L154

    public static function registerDependentBundles(BundleCollection $collection): void
    {
        $collection->addBundle(PimcoreDataHubBundle::class, 20);
        $collection->addBundle(new FlysystemBundle());
        $collection->addBundle(new PimcoreAdminBundle(), 60);

        if (\Pimcore\Version::getMajorVersion() >= 11) {
            // Missed priority
            $collection->addBundle(
                \Pimcore\Bundle\ApplicationLoggerBundle\PimcoreApplicationLoggerBundle::class
            );
        }
    }

When I defined priority to 1, the logger's js code has been initialized earlier, so the functionality works correctly. @dvesh3 in my opinion this should be corrected in the bundle code as below:

$collection->addBundle(\Pimcore\Bundle\ApplicationLoggerBundle\PimcoreApplicationLoggerBundle::class, 1);

Temporary solution:

config/bundles.php

<?php

use Pimcore\Bundle\ApplicationLoggerBundle\PimcoreApplicationLoggerBundle;
use Pimcore\Bundle\DataHubBundle\PimcoreDataHubBundle;
use Pimcore\Bundle\DataImporterBundle\PimcoreDataImporterBundle;

return [
    PimcoreApplicationLoggerBundle::class => ['all' => true],
    PimcoreDataHubBundle::class => ['all' => true],
    PimcoreDataImporterBundle::class => ['all' => true],
];

@fashxp
Copy link
Member

fashxp commented Aug 28, 2023

we need to set priority of application logger bundle properly.

@dvesh3
Copy link
Contributor

dvesh3 commented Aug 29, 2023

Fixed by #351

@dvesh3 dvesh3 closed this as completed Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants