Month: October 2016

Drupal

Drupal 8 study note 1 Altering existing routes

Altering existing routes Create src/Routing/RouteSubscriber.php in your module. It will hold the route subscriber class: <?php namespace Drupal\mymodule\Routing; use Drupal\Core\Routing\RouteSubscriberBase; use Symfony\Component\Routing\RouteCollection; class RouteSubscriber extends RouteSubscriberBase { /** * {@inheritdoc} */ public function alterRoutes(RouteCollection $collection) { // Change path of...

magento 2

Magento 2 add static Block

To update cms static block for particular store programmatically you can use following code $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $identifier = 'block_identifier'; $store_id = 2; try { $block = $objectManager->create('Magento\Cms\Model\Block'); $block->setStoreId($store_id); // store for block you want to update $block->load($identifier, 'identifier'); $block->setIdentifier($identifier);...

magento 2

Magento 2: How to truncate customers, products, reviews and orders table

http://magento.stackexchange.com/questions/102936/magento-2-how-to-truncate-customers-products-reviews-and-orders-table SET FOREIGN_KEY_CHECKS = 0; Truncate order tables TRUNCATE TABLE `gift_message`; TRUNCATE TABLE `quote`; TRUNCATE TABLE `quote_address`; TRUNCATE TABLE `quote_address_item`; TRUNCATE TABLE `quote_id_mask`; TRUNCATE TABLE `quote_item`; TRUNCATE TABLE `quote_item_option`; TRUNCATE TABLE `quote_payment`; TRUNCATE TABLE `quote_shipping_rate`; TRUNCATE TABLE `reporting_orders`; TRUNCATE TABLE...

vagrant

vagrant reinstall virtualbox ssh lost default: Error: Authentication failure. Retrying…

ssh vagrant@localhost -p 2222 then copy the public key content fromhttps://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub to the authorised_keys file with the following command echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > .ssh/authorized_keys When done exit the VM and try vagrant ssh again. It should...

magento

magento 1.x Mage_Customlogin_Helper_Data’ not found in …./app/Mage.php on line 546″

I follow the article in Internet , 1.check the config.xml <global> <blocks> <customerlogin> <class>CustomerParadigm_Customerlogin_Block</class> </customerlogin> </blocks> <helpers> <customerParadigm_customerlogin> <class>CustomerParadigm_Customerlogin_Helper</class> </customerParadigm_customerlogin> </helpers> it is ok finally I found the problem from system.xml and remove module="customlogin" it work ! <groups> <general translate="label"...