I have tried to add product with bundle type that time getting error like below.
Could not save child: "Unknown entity type: Magento\Bundle\Model\Selection\Interceptor requested"
i got same issues for this trouble, i resolved by add interface : Magento\Framework\ObjectManager\NoninterceptableInterface to
Magento\Bundle\Model\Selection
the final class define look like:
class Selection extends \Magento\Framework\Model\AbstractModel implements
\Magento\Framework\ObjectManager\NoninterceptableInterface
Change
class Selection extends \Magento\Framework\Model\AbstractModel
to
class Selection extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\ObjectManager\NoninterceptableInterface
on below file
vendor/magento/module-bundle/Model/Selection.php
Related
I develop the flutter app connected with Firebase.
The app work well on mobile devices, but when i try to build web i get this error:
/D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_database_web-0.1.2/lib/src/interop/app.dart:35:59: Error: The method 'delete' isn't defined for the class 'AppJsImpl'.
- 'AppJsImpl' is from 'package:firebase_database_web/src/interop/app_interop.dart' ('/D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_database_web-0.1.2/lib/src/interop/app_interop.dart').
package:firebase_database_web/…/interop/app_interop.dart:1
Try correcting the name to the name of an existing method, or defining a method named 'delete'.
Future delete() => core_interop.handleThenable(jsObject.delete());
I tried to put firebase_database_web: ^0.1.2+1 in pubspec.yaml, but error is still here.
Did someone have the same problem, and how are you fixed?
Thanks
I have tackled the issue by adding a row in the "app_interop.dart" file.
Before:
#JS('App')
abstract class AppJsImpl extends core_interop.AppJsImpl {
external DatabaseJsImpl database(String? databaseURL);
}
After:
#JS('App')
abstract class AppJsImpl extends core_interop.AppJsImpl {
external DatabaseJsImpl database(String? databaseURL);
external dynamic delete();
}
Add the latest version of firebase_database_web to your pubspec.yaml
Fixed it for me.
I have a class TripController that contains a private field _updatedAccount. I created a getter in order to get from outside.
class TripController {
final String _accountId;
final BuildContext _context;
Account _updatedAccount;
Account updatedAccount() => _updatedAccount;
TripController(this._accountId, this._context);
...
}
In another class, where I perfectly have access to the TripController class, I have the code :
onTap: () {
TripController _tripController =
new TripController(_account.id, context);
_tripController.add(context);
_account.trips = _tripController.updatedAccount.trips;
_account.notifyListeners();
},
And here, updatedAccount from _tripController.updatedAccount.trips is underlined in red with the message : The getter 'updatedAccount' isn't defined for the class 'TripController'
Did I misdeclared the getter ?
Okay, I finally fixed it. I don't know why, but I had to delete the code related to TripController, and ther re-write it again. I don't know why, maybe it was an Editor problem, I'm using VScode.
You have declared updatAccount() as a method, not as a getter. Use _tripController.updatedAccount().trips; or change the method to a getter Account get updatedAccount => _updatedAccount;
I faced this error and the problem was my IDE, not my code.
This solution worked for me in Android Studio :
File -> Invalidate Catches... -> Invalidate And Restart
You are using the classic method syntax declaration, in Dart language, prefer using this kind of syntax for getters:
Account get updatedAccount => _updatedAccount;
And call it the way you did.
Else you should call it like a classic method:
_tripController.updatedAccount().trips
Please follow this link for further information:
https://dart.dev/guides/language/language-tour#getters-and-setters
If you want to use import 'package:flutter_svg/svg.dart'; package then you need to follow these steps.
step 1. -> Open the termial in the IDE and run this command -> flutter pub add flutter_svg
step 2. -> Then run this command -> flutter pub get
step 3. -> Now import this package -> import 'package:flutter_svg/flutter_svg.dart';
Try to check the model class name you use might the same with existing name of Widget or Plugin
Check your imported libraries on the top of your file where the problem is. In my case, Android Studio auto-imported an object from the core Flutter library with the same name as the model I've defined on my own.
I just deleted the import and then imported my own object from my_models.dart file.
How can i use custome class in SYmfony 2 ?
I created class "Social" where i defined the namespace "namespace W4Pro\Social Bundle\Class" and located in directory "W4Pro\SocialBundle\Class". Now i want to use this class in my controller "W4Pro\SocialBundle\Controller\DefaultController", i used this "use W4Pro\SocialBundle\Class\Social;" but when i run the page i received the error
Cannot import resource "C:\xampp1\htdocs\test\src\W4Pro\SocialBundle/Controller/" from "C:/xampp1/htdocs/test/app/config\routing.yml". (Class W4Pro\SocialBundle\Controller\Social does not exist)
I have one controller in a subfolder which works perfect:
route:
Route::resource('json/stock/equipmentImages', 'Stock_EquipmentImageController');
getting its class from controller/stock/EquipmentImageController.php
which has a class definition:
class Stock_EquipmentImageController extends \BaseController {
The strangest thing happens if I do the same with:
Route::resource('json/stock/equipmentLocations', 'Stock_EquipmentLocationController')
Then I get the message, class not found.
If I move the class from controller/stock/EquipmentLocationController.php to
controller/EquipmentLocationController.php and adjust the route to:
Route::resource('json/stock/equipmentLocations', 'EquipmentLocationController');
Everything works. This happens on a shared server without command line access. On my localhost all controllers can be put into a subfolder.
I wasn't using namespace which worked fine on my local host but gave issues on my public server. Namespacing everything DID solve the issues as suggested by egig. Thanks.
Here's what I did, in case others have similar issues:
I went through this nice tutorial: https://www.youtube.com/watch?v=yAzd7Ig1Wgg
to get familiar with namespacing, as this is relative new for me in for Laravel 4.
router setup (resource router):
Route::resource('json/stock/equipment', 'App\Controllers\Stock\EquipmentController');
Added the psr 0 setting to autoload: (instead of using classmap) like the video suggests.
,
"psr-0": {
"Stock": "app/controllers/"
} ....
Did not add anything to the basecontroller (no namespacing description):
class BaseController extends Controller {
public function __construct(){ ....
Added namespacing and dependencies to my controller in subfolder (controllers\stock):
namespace App\Controllers\Stock;
use BaseController, Form, Input, Redirect, View, Equipment, Response;
class EquipmentController extends BaseController { ....
Then placed my models in a subfolder (models\stock), without namespacing discription.
class Equipment extends \Eloquent {
protected $fillable = [
'description',
'location',
....
Then I did 'php artisan dump-autoload' and uploaded everything to my public server, changed database and public folder settings accordingly, because they are different. And everything worked!
Feedback is welcome, thanks for the support!
I have to implement a custom action to search the windows registry for the installed version of the dotnet framework. Therefore I thought to extend the ReadRegistryValueAction to integrate my individual search algorithm. But the custom action will not be found at the IDE. So I extends the action from the AbstractInstallAction and included the RegistryRoot class to configure the action inside the IDE the same way as with provided registry actions of install4j framework.
public class CheckDotNetInstallationAction extends AbstractInstallAction {
private RegistryRoot registryRoot;
public RegistryRoot getRegistryRoot() {
return registryRoot;
}
public void setRegistryRoot(RegistryRoot registryRoot) {
this.registryRoot = registryRoot;
}
#Override
public boolean install(InstallerContext paramInstallerContext)
throws UserCanceledException {
// do custom search
return false;
}
}
But instead to get a dropdown list, there is only a blank field. I expected also a dropdown list the same way as in the present registry action. Now there are two questions:
Is it possible to extends existing actions/screens/forms and to use and configure it in the IDE or is it necessary to extends from the AbstractInstallAction?
How can I use classes like RegistryRoot for my custom components the same way as they are used in the actions provided by the install4j framework? Specifically the way to configure these components inside the IDE.
You have to add add a BeanInfo class and set an enumeration mapper. See the source file
samples/customCode/SampleActionBeanInfo.java
in your install4j install4j Installation and and look for the the call to setEnumerationMappers.