Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

You've missed out = [] after array $data, if the parameter is not provided to the constructer it will then be null, as you haven't specified a default of []


0

Did you maybe run setup:di:compile and then change your code to a different order? That would throw this error. Other than that not sure.


0

This turned out to be caused (at least in part) by Zend OpCache; a type of PHP code cache which had been set up on the server. It was solved by restarting the httpd and php-fpm services, and then configuring Zend OpCache to revalidate PHP files based on timestamps (which can be disabled when running sites in production mode, as long as care is taken to flush ...


0

If you have model for your custom table then you do all these stuffs in the below way Try this, Di method : Inject your model in your constructor protected function __construct( .... \Vendor\ModuleName\Model\ModelName $customTable, .... ) { ... $this->customTable = $customTable; ... } then on your execute function from controller ...


0

I am not sure to understand what you are trying to achieve but you should look at the getUrl method definition : app/code/core/Mage/Core/Block/Abstract.php:1001. The first param of this method should be the 'route' : i.e ỳour_router_name/your_controller_name/your_action_name. And if you want to pass param, it should be as an array in the second param of the ...


1

@Remco Hendriks, in "Vendor\Module\view\adminhtml\ui_component\cms_page_form.xml" it's better to use field like in Magento_Caatalog module to have correct image display after page save. In your case image is broken. <field name="image" sortOrder="110" formElement="fileUploader"> <argument name="data" xsi:type="array"> <item name="...


0

Delete Module Entry in setup_module table And run setup:upgrade


0

Did you try this php bin/magento module:enable Vendor_Extension Although giving it more thought it might have disabled itself due to invalid key. Does have any kind of activation key? If in doubt I would contact the extension developer.


0

Good entry point to debug: \Magento\Framework\App\StaticResource::launch var_dump($params) after $this->parsePath($path); Module key is empty? Reason would probably be a problem with registration.php and/or module.xml


1

I guess this can help you https://magento.stackexchange.com/a/84982/45214 . In the above link, the BaseUrl is already obtained from storemanager and it will return the store's baseurl. If you have enabled the configuration from the backend to display store_code (for ex. en_US) along with the BaseUrl in the URL, then it will return the BaseUrl/store_code/ as ...


1

Use store emulation (Magento\Store\Model\App\Emulation) to set store for backend operation and Try below code. return $this->storeManagerInterface->getStore()->getBaseUrl().$this->emailHelper->dynamicUrl().'/oId/'.$orderData->getIncrementId().'/fId/'.$this->getFollowUpId(); It should work.


0

You can add your changes in _theme.less file in your new theme. Make sure your theme have parent Magento/blank define in theme.xml file path [yourtheme]/web/css/source/_theme.less _module.less is intends for add customises for individual module by add your changes inside theme instead code Example [yourtheme]/Magento_Catalog/web/css/source/_module....


0

To override the visual element of the theme, you must extend a theme. The module is to override the functions and style the element around that module, overriding styles are not modules primary task. With an extended theme, you can override the styles, classes, and templates.


0

Please follow these steps. Change to your Magento Directory find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + sudo chown -R <Magento User>:<web server group> . chmod u+x bin/magento Once permission is set deploy your files as ...


0

Please try by giving 777 permission to generated and var folder Try after Removing generated folder and var/cahe var/di and var/page_cache and var/view_processed and try it . Will be better if you try on local first instead of directly on live.


1

If you want to have the header and footer, your layout need to update something else than empty (1column, 2columns-left, 2columns-right, 3columns). <?xml version="1.0"?> <!-- /** * Copyright © Joshua Flood. All rights reserved. * See COPYING.txt for license details. */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...


0

Using this other answer i was able to understand better what i needed to do. I created a file called "events.xml" and a Observer class. This way a module is able to listen to a specific event and act upon it.


0

You can check if controller is home page then add your logging for home page controller. Check this link on mageplaza https://www.mageplaza.com/devdocs/how-check-current-url-homepage-magento-2.html <?php namespace Mageplaza\HelloWorld\Block; class HelloWorld extends \Magento\Framework\View\Element\Template { protected $_logo; public function ...


0

A better way could be public function match(\Magento\Framework\App\RequestInterface $request){ if (!$this->dispatched) { $identifier = trim($request->getPathInfo(), '/'); if (strpos($identifier, 'matinteg/orders') !== false) { $request->setModuleName('cms')->setControllerName('integration')->setActionName('integration'); ...


0

After researching further, I have discovered that it is not possible. Theme styles take priority and will always override module styles where there is a conflict. As per Anthony's comment, if a parameter value is appended with !important, then the style may be successfully rendered. This will not work when using .lib-css() and so it should not be treated ...


1

When you run php bin/magento module:disable Company_Commercebug, It will disable the module in app/etc/config.php <?php return [ ... 'Company_Commercebug' => 0, ... ] ]; So once your extension will be disabled, you need to remove it's statis using below process: Remove following : pub/static - Do not delete .htaccess var/cache var/...


0

I think the file system permissions must have been incorrect somewhere along the way; after I deleted the generated folder and ran through the compile and upgrade processes, it worked fine. The code listed in the question is correct.


1

Try deleting the generated directory - rm -rf generated/


0

Insufficient data: Fatal error: Uncaught Error: Call to a member function hasData() on null in this error is in complete please provide full error log as it is you can find your full log at sudo tail -f /var/log/php-fpm/www-error.log your full error is looks like as below: Uncaught Error: Class 'Classname' not found in /[file_path]/[filename.php]:[...


0

You need to create an admin configuration field for "Button position" with 3 values consisting of the name of the three blocks added in your xml file ('test1.tab', 'test2.tab'and the third one) Then, your xml should look like: <referenceBlock name="product.info.addtocart"> <block class="Vendor\Module\Block\CustomButton" name="test1.tab" template=...


0

Change your overwrite class by following code: <?php namespace SR\MagentoCommunity\Model\Product; use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; class Url extends \Magento\Catalog\Model\Product\Url { /** * Retrieve URL Instance * * @return \Magento\Framework\UrlInterface */ private function getUrlInstance() { ...


1

Create XML file at in your custom extension : app/code/Vendor/Module/view/frontend/layout/customer_account_login.xml Add below content: <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> ...


1

All you need is the following steps Not sure if you are still looking for the answer: Step one is in your module create -> view/frontend/templates/layout/customer_account_login.xml You are only focusing on the login page so do the following and view/frontend/templates/form/login.phtml add what you change is example: add the h1 tag and test it out Link ...


0

All you need is the following steps Not sure if you are still looking for the answer: Step one is in your module create -> view/frontend/templates/layout/customer_account_login.xml You are only focusing on the login page so do the following and view/frontend/templates/form/login.phtml add what you change is example: add the h1 tag and test it out


0

I was facing the same issue with my less updates noting showing unless I flushed my static files. The fix for me was to disable mod_expires. This was caching the css and etc. Inside of the pub/static/.htaccess file you will should have something like the following: <IfModule mod_expires.c> ############################################ ## Add default ...


0

Change layout XML file name. Magento layout xml file name always in small letters. replace it oneStepCheckOut_oneStepCheckOut_billingAddress.xml with file name onestepcheckout_onestepcheckout_billingaddress.xml


0

The modules you listed belong to MSI 1.1.1 which is deployed along with Magento 2.3.1. All these modules supposed to be enabled if MSI was enabled before. If it was disabled beforehand on Magento 2.3.0 - the new modules should be disabled as well. You can read more about this here - https://github.com/magento-engcom/msi/wiki/MSI-Release-Notes-and-...


0

It looks like you disabled inventory management Source It's for Multi Source Inventory (MSI) project Check do you have this in your composer.json magento/inventory-composer-metapackage = ^1.1.0 And from this link above 2.2.X Magento installation to Magento 2.3.X, Inventory Management modules will be disabled by default.


1

Yes you can. You can create the etc/view.xml file in one of your modules and it should be picked up. Take as example the etc/view.xml file from Magento_Swatch module.


2

Models are Data Interface are used to only hold the data in objects, i.e to set and get data for a row. ResourceModels are a mechanism which is responsible for the persistence of such data, i.e execute the SQL query to actually save or load data into the Model object. The correct way to load and save should be by creating a repository or loading from a ...


0

it will find & disable all modules except which one start with Magento_ $ php bin/magento module:status | grep -v Magento | grep -v List | grep -v None | grep -v -e '^$'| xargs php bin/magento module:disable To disable all module for particular vendor, you could use something like this $ php bin/magento module:status | grep VendorName_ | grep -v List |...


0

One can use magento module:status to create lists of extensions. By wrapping this into $() it is executed first. It filters out the extensions that we want by using grep and adds a negative grep to be certain we dont match unwanted stuff. How to enable all modules from Vendor Foo_ The base command to enable all modules from Foo_ is like this php bin/...


1

It is because you have printed information in the observer. I think it is not because you have used getRequest() in the observer. Try to see the result in this way. $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log'); $logger = new \Zend\Log\Logger(); $logger->addWriter($writer); $logger->info(print_r($this->request->getParams(), ...


1

Did you try with : //\Magento\Framework\App\RequestInterface $this->_request->getParam('field_name'); Its working for me. Hope it will work for you too.


0

Try this way: /** * @var \Magento\Framework\App\RequestInterface */ public $request; public function __construct( ... \Magento\Framework\App\RequestInterface $request ){ ... $this->request = $request; } public function execute(Observer $observer) { $post = $this->request->getPost(); /* or */ $param = $...


1

Try using \Magento\Framework\App\RequestInterface::getParams() In replacement for: \Magento\Framework\App\Request\Http::getParams()


0

Create _module.less file inside Vendor\Module\view\frontend\web\css\source\ and write below code inside & when(@media-common = true) { // write here your css } Then run below commands php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento cache:flush


0

Try this, <script> require(['jquery','FlipBook'], function($){ $('#side').FlipBook({ pdf: 'sample.pdf', }); }); </script> For more about the implementation custom javascript implementation Hope this helps.


1

it will find & disable all modules except which one start with Magento_ $ php bin/magento module:status | grep -v Magento | grep -v List | grep -v None | grep -v -e '^$'| xargs php bin/magento module:disable To disable all module for particular vendor, you could use something like this $ php bin/magento module:status | grep VendorName_ | grep -v List |...


0

One option is to execute php bin/magento module:disable $(php bin/magento module:status | grep -vE '^Magento|List of enabled modules:|List of disabled modules:|None|^$') It will grep all none core modules and pass them as a list to the disable command https://www.michiel-gerritsen.com/disabling-non-magento-modules-magento-2/


Top 50 recent answers are included