Magento 2.3.4 Setup_Module - module

Magento 2.3.4 setup_module table does not show newly installed module as well as most of the default modules?

Module register in setup_module database use Two file
app/code/vendor/module_name/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'vendor_modulename',
__DIR__
);
And second file ,
app/code/vendor/module_name/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="vendor_modulename" setup_version="1.1.0">
</module>
</config>
After created file and run this command,
php bin/magento s:up
php bin/magento c:f
Hope the help
Thanks.

Related

Wicket 8 web.xml myproject example

Never having use Wicket before I installed Apache Wicket 8.0.0-M8 on Windows 10. I also installed apache-tomcat-9.0.7.
I replaced the following Tomcat conf folder files with those provided by wicket:
context.xml, server.xml
I used Eclipse Neon's Maven option to create a project called myproject. Eclipse generated the following web.xml file which I relocated to:
<TOMCAT_HOME>\webapps\myproject\WEB-INF
That web.xml file looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
<display-name>myproject</display-name>
<!--
There are three means to configure Wickets configuration mode and they
are tested in the order given.
1) A system property: -Dwicket.configuration
2) servlet specific <init-param>
3) context specific <context-param>
The value might be either "development" (reloading when templates change) or
"deployment". If no configuration is found, "development" is the default. -->
<filter>
<filter-name>wicket.myproject</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.quantech.myproject.WicketApplication</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>wicket.myproject</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Eclipse found the following problems with this file:
Referenced file contains errors (http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-app_3_1.xsd). web.xml /myproject/src/main/webapp/WEB-INF line 1 XML Problem
TargetNamespace.1: Expecting namespace 'http://java.sun.com/xml/ns/javaee', but the target namespace of the schema document is 'http://xmlns.jcp.org/xml/ns/javaee'.
When I load web.xml into XMLSpy I get the message:
This file is not valid. Root element 'web-app' is not defined in DTD/Schema.
Anyone have a clue what is wrong here?
thanks,
Terry
I replaced the following Tomcat conf folder files with those provided by wicket:
context.xml, server.xml
Wicket doesn't provide such files!
Eclipse generated the following web.xml file
Eclipse found the following problems with this file:
Bad Eclipse!
Just ignore these errors/warnings. Tomcat won't complain.
To make Eclipse happy you will have tweak its configuration. I can't help you with that though. I use different IDE.

How to share common libraries in Jboss7

Hi friends,
i have more than one WAR in my server, each war has some common libraries(.jar). How to share the common libraries in JBoss7. please anybody help me..
Created a directory : mkdir -p JBoss_HOME/modules/com/common/lib/main
Placed all jars inside main dir
Created module.xml under main dir.
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.common.lib">
<resources>
<resource-root path="JarName-1.0.1.jar"/>
</resources>
</module>
Created jboss-deployment-structure under WEB-INF & packed the war deployment file.
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.comman.lib"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
You can create custom module of common jar files and add application dependency(war) on custom module through jboss-deployment-structure.xml file

override AbstractPdf.php file in magento 2

I have a problem with the PDF invoice and i'm trying to override the AbstractPdf.php file, I have done the following:
1)Created the following directories and files:
a. 'app\code\Ochos\fixPDF\registration.php':
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Ochos_fixPDF',
__DIR__
);
b. 'app\code\Ochos\fixPDF\etc\di.xml':
<?xml version="1.0" ?>
<config>
<preference for="vendor\magento\module-sales\Model\Order\Pdf\AbstractPdf" type="Ochos\fixPDF\Model\Order\Pdf\AbstractPdf" />
</config>
c. 'app\code\Ochos\fixPDF\etc\module.xml':
<?xml version="1.0"?>
<config>
<module name="Ochos_fixPDF" setup_version="2.0.0"/>
</config>
d. 'app\code\Ochos\fixPDF\Model\Order\Pdf\Abstract.php': the file that I have made changes in.
2)enabled the extension in config.php
3) Executed the following:
php -f bin/magento module:enable --clear-static-content Ochos_fixPDF
php -f bin/magento setup:upgrade
it seems that the extension is enabled, but no changes are made in the invoice PDF.
What am I doing wrong?
Thanks!
The problem is the function you want override is a protected function. I have other post and explain how we can change the function.
You have to preference to invoice.php and create the function into this file.
See this post: https://magento.stackexchange.com/questions/153308/override-abstractpdf-class-in-magento2

How to add xml file during installation using wix

I want to create the following xml during the installation created by wix 3.9.
<?xml version="1.0" encoding="utf-8"?>
<MappedUsers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UsersList>
<LyncUserID>
<CustomUserName>John.Smith</UcaUserName>
</LyncUcaUserID>
</UsersList>
</MappedUsers>
Tried creating the file using following code but got the error message during installtion that file doesn't exists.
<?define UserNameFile="[AppDataFolder]ThirdParty\LyncUcaUserMapping.XML" ?>
<util:XmlFile Id="UserMapping" Value="[USER_NAME]" ElementPath="/UsersList/LyncUserID/add[\[]#key='UcaUserName'[\]]" Action="setValue" File="$(var.UserNameFile)" Name="value" Sequence="7" />
Since I could not create the file during the installation I created the file manually and placed in my appdata folder. But then above code didn't work either as it says "failed to find the following node".
What am I missing?
Best method to do this is first you copy a sample xml file as below.
<?xml version="1.0" encoding="utf-8"?>
<MappedUsers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
</MappedUsers>
Then edit it using a custom action.
Here is a link which shows how to edit xml files using c#
http://support.microsoft.com/kb/301233
Following link shows how to add custom actions to a wix project.
http://wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html

Rewrite a class in magento

I have been trying to rewrite a class in Magento and I be doing all the correct procedures, however I am not getting.
I'm trying to rewrite app\code\core\Mage\Catalog\Model\Product\Attribute\Media\Api.php
Thanks in advance to anyone who can help me.
<config>
<modules>
<Namespace_Catalog>
<version>1.6.0.0.14</version>
</Namespace_Catalog>
</modules>
<global>
<models>
<catalog>
<rewrite>
<product_attribute_media_api>Namespace_Catalog_Model_Product_Attribute_Media_Api</product_attribute_media_api>
</rewrite>
</catalog>
</models>
</global>
</config>
Yeah I forgot to say that part
In the app/etc/modules/ I have with depends tag. I've tried with and without the tag depends and it never worked. I think I'm really doing everything right.
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Catalog>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Catalog />
</depends>
</Namespace_Catalog>
</modules>
</config>
In the app\code\local\Namespace\Catalog\Model\Product\Attribute\Media\Api.php I have
class Namespace_Catalog_Model_Product_Attribute_Media_Api extends Mage_Catalog_Model_Product_Attribute_Media_Api
I rewrote the function removes and let it equal to the original, but with Mage::log('rewrote', null, 'rewrote.log'), to know that he had successfully rewritten.
I cleared my cache.
I corrected codePool tag for case sensitive.
I checked /var/log/ and not found any error inside exception.log and system.log.
My Index.php is set as developer mode and ini_set('display_errors', 1); uncommented.
I followed a tutorial on Magento here
This describes the state of your Magento system. It lists all modules, models, classes, event listeners or almost anything else you could think of. For example, consider the config.xml file you created above. If you search the XML file in your browser for the text Namespace_Catalog_Model_Product_Attribute_Media_Api you'll find your class listed. Every module's config.xml file is parsed by Magento and included in the global config.
Here is my class to write. It seems okay. What can I be missing?
<catalog>
<class>Mage_Catalog_Model</class>
<resourceModel>catalog_resource</resourceModel>
<rewrite>
<product_attribute_media_api>Namespace_Catalog_Model_Product_Attribute_Media_Api</product_attribute_media_api>
</rewrite>
</catalog>
Your code seems to be right.
Have you created an XML-file in app/etc/modules/?
It should look like:
Namespace_Catalog.xml
< ?xml version="1.0"?>
<config>
<modules>
<Namespace_Catalog>
<active>true</active>
<codepool>local</codepool>
</Namespace_Catalog>
</modules>
</config>
i think you missed something
<version>1.6.0.0.14</version>
should be same with
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Catalog>
<active>true</active>
<codepool>local</codepool>
<version>1.6.0.0.14</version>
</Namespace_Catalog>
</modules>
"Codepool" is case sensitiv.
Try:
<codePool>local</codePool>
instead of
<codepool>local</codepool>