When i make compailation ,ige a error in magento 2.2.9 [ReflectionException] Class Magento\Framework\Setup\Patch\PatchApplier does not exist - class

[ReflectionException] Class Magento\Framework\Setup\Patch\PatchApplier does not exist
enter image description here

Related

VSCode wants to import library from folder, that doesn't exist because it has been renamed

I created a folder for my model called platform_Account.
After I created my model PlatformAccount there, I decided to rename it to platform_account_model.
When I now try to import my model to other files, I am getting this error:
List<PlatformAccount> accountList
The argument type 'List<PlatformAccount> (where PlatformAccount is defined in c:\Users\Wizzel\Desktop\project\lib\models\platform_account_model\platform_account_model.dart)' can't be assigned to the parameter type 'List<PlatformAccount> (where PlatformAccount is defined in c:\Users\Wizzel\Desktop\project\lib\models\platform_Account\platform_account.dart)'
.dartargument_type_not_assignable
list.dart(52, 16): List is defined in C:\Users\Wizzel\fvm\versions\2.8.1\bin\cache\pkg\sky_engine\lib\core\list.dart
platform_account_model.dart(8, 7): PlatformAccount is defined in c:\Users\Wizzel\Desktop\project\lib\models\platform_account_model\platform_account_model.dart
list.dart(52, 16): List is defined in C:\Users\Wizzel\fvm\versions\2.8.1\bin\cache\pkg\sky_engine\lib\core\list.dart
platform_account.dart(8, 7):
PlatformAccount is defined in c:\Users\Wizzel\Desktop\project\lib\models\platform_Account\platform_account.dart
but the platform_Account folder doesn't exist.
How do I fix this?
I fixed it by deleting all import statements and letting VSCode resolve the import paths again.

Class not found error on custom TYPO3 extension

I have a custom frontend extension that I have installed on TYPO3 10.
I took a snippet of code from another friend extension and I have some problem to declare the hook class:
under hooks I have a file PageLayoutView.php.
class PageLayoutView implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface {...
Then in the ext_localconf.php I have added this line:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'][$_EXTKEY] = \MyVendor\myTheme\Hooks\PageLayoutView::class;
in ext_tables.php file i have the following namespace:
call_user_func(
function()
{
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Myvendor.myExtname',
'Templates',
'Ext name'
);
In the backend I get this error:
(1/1) Error
Class 'MyVendor\myTheme\Hooks\PageLayoutView' not found
what i'm missing here ?
Did you try to dump the autoload information in the TYPO3 Install Tool?
If it's a composer based installation, try to remove the extension completely and require it again afterwards.
And you should check the namespace in PageLayoutView.php.

Fatal error: Uncaught ArgumentCountError: Too few arguments to function TYPO3\CMS\Core\Imaging\IconFactory::__construct()

After following the composer installation guide for v10 of typo3. I pointed apache vhost to the public folder. Once I navigate to the index.php location in the browser, I get this error
Fatal error: Uncaught ArgumentCountError: Too few arguments to function
TYPO3\CMS\Core\Imaging\IconFactory::__construct()
0 passed in /home/user/projects/typo3/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php
on line 3423
and exactly 2 expected in
/home/user/projects/typo3/public/typo3/sysext/core/Classes/Imaging/IconFactory.php:71
It looks like a dependency injection problem. Please can anybody help with this error
For me this issue occured after moving an existing project from a server into DDEV (which is similar to changing the path/URL by a vhost config). My guess is it has to do with changed paths/URLs in cached files. This is how I solved it:
A) Manually delete all cached files:
t3project$ rm -rf public/typo3temp/*
t3project$ rm -rf var/*
B) Also I had to change the ownership of some autogenerated folders/files to my current user (sudo chown -R myuser:myuser t3project/), then I was able to use the "Fix folder structure" tool in "Environment > Directory Status", now everything was working fine again. Not sure if the last step is helpful for you, as it might be only related to my case where certain folder/files had a wrong owner as they was copied.
I had the same problem today and it occured because I was XClass'ing one of the Core Classes and used GeneralUtility::makeInstance(IconFactory::class) in this code.
The fix is to use DI in this class, just as you suggested. Also flush all caches afterwards to rebuild the DI container.
From this:
class CTypeList extends AbstractList
{
public function itemsProcFunc(&$params)
{
$fieldHelper = GeneralUtility::makeInstance(MASK\Mask\Helper\FieldHelper::class);
$storageRepository = GeneralUtility::makeInstance(MASK\Mask\Domain\Repository\StorageRepository::class);
...
To this:
class CTypeList extends AbstractList
{
protected StorageRepository $storageRepository;
protected FieldHelper $fieldHelper;
public function __construct(StorageRepository $storageRepository, FieldHelper $fieldHelper)
{
$this->storageRepository = $storageRepository;
$this->fieldHelper = $fieldHelper;
}
public function itemsProcFunc(&$params)
{
$this->storageRepository->doStuff();
$this->fieldHelper->doStuff();
...
For future reference for others:
This can also happen in own extensions when the Core uses GeneralUtility::makeInstance on your classes. (e.g. in AuthenticationServices).
The trick here is to make these DI services public like so:
(in extension_path/Configuration/Serivces.yaml)
services:
_defaults:
autowire: true
autoconfigure: true
public: false
Vendor\ExtensionName\Service\FrontendOAuthService:
public: true
Here's documentation for it:
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/DependencyInjection/Index.html#knowing-what-to-make-public
I had this error because i used the Services.yaml file in one of my extensions, but did not configure it correct.
More infos about the file itself can be found here
Since the file is responsible for the dependency injection, small mistakes e.g. in namespaces lead to the above mentioned error.
To locate the error you can uninstall extensions with a Services.yaml.
When you have found the file/extension, you have to check if all Namespaces in the Classes Directory are correct.
This means:
All filenames are correct regarding the Class they contains
All Namespaces in the files are correct for path and filename
The Namespace can be found via composer. So the extension have to be installed via composer or must have an entry in the autoload list of composer.json

Error: Could not find or load main class files\kafka_2.12-2.4.0\libs\activation-1.1.1.jar;

Error: Could not find or load main class
files\kafka_2.12-2.4.0\libs\activation-1.1.1.jar;
It would appear you may have put Kafka in "Program files" directory.
On windows, the kafka path cannot contain spaces. Try c:\kafka

OrientDB 3 sql script error

I'am migrating from ODB 2.2.29 to 3.0.1 and I find an error that I have not been able to understand.
I have a class called 'EdgeAttrib'. The class does not exist yet in the DB.
Now consider this code:
let exist = select from (select expand(classes) from metadata:schema) where name = 'EdgeAttrib';
if ($exist.size()>0) {
delete vertex EdgeAttrib;
drop class EdgeAttrib;
}
work well in 2.2.29 and fail in 3.0.1. Even more, the same code for other class work fine.
When I run it, it throw:
com.orientechnologies.orient.core.exception.OCommandExecutionException: Class not found: EdgeAttrib DB name="Test"
That happend when try to execute the "delete vertex" line, but the class does not exist so it should never run that line.
I run this code in the ODB Studio.
The fix was added in version 3.0.3.