Varnish making admin ajax very slow

We are on Magento1.7 using Varnish+nginx+HHVM. Frontend part of the website is fast but on the admin side specifically when there AJAX calls it will take a lot of time. I observed that disabling Varnish is making admin load quickly but unable to figure out why varnish is causing this problem. Please note that we have an instruction that not to cache admin part and yes we don’t have cache issues but performance is killing us. Please help me with a way to solve this problem.

Add Customer Attributes through Admin Form

I’m trying to build a extension where I can dynamically add new Customer Attributes just like I would do with Product Attributes. The thing is that I’m new to Admin Grid and I’m not finding the a few references such as required fields for a customer attribute and how to sync frontend_type with Options Tab. So far this is what I got:

    // controllers/AttributesController.php      protected function editAction()     {         $  attributeId = $  this->getRequest()->getParam('attribute_id');         $  attributeModel = Mage::getModel('customer/attribute')->load($  attributeId);          if ($  attributeModel->getId() || $  attributeId == 0) {             Mage::register('entity_attribute', $  attributeModel);             Mage::register('customer_attribute_data', $  attributeModel);             $  this->loadLayout();             $  this->_setActiveMenu('customer');             $  content = $  this->getLayout()->createBlock('dev_customerattributes/adminhtml_attributes_edit');             $  left = $  this->getLayout()->createBlock('dev_customerattributes/adminhtml_attributes_edit_tabs');             $  this->_addContent($  content)->_addLeft($  left);              $  this->renderLayout();         } else {             Mage::getSingleton('adminhtml/session')->addError('Customer attribute does not exist');             $  this->_redirect('*/*/');         }     } 
    // Block/Adminhtml/Attributes/Edit.php  class Developer_CustomerAttributes_Block_Adminhtml_Attributes_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {     public function __construct()     {         $  this->_objectId = 'attribute_id';         $  this->_blockGroup = 'dev_customerattributes';         $  this->_controller = 'adminhtml_attributes';          parent::__construct();          $  this->_updateButton('save', 'label', 'Save Todo');         $  this->_updateButton('delete', 'label', 'Delete Todo');     }      public function getHeaderText()     {         if (Mage::registry('customer_attribute_data') && Mage::registry('customer_attribute_data')->getId()) {             return $  this->__('Edit Customer Attribute "%s"', $  this->htmlEscape(Mage::registry('customer_attribute_data')->getData('attribute_code')));         } else {             return $  this->__('Add Customer Attribute');         }     } } 
    // Block/Adminhtml/Attributes/Edit/Form.php  class Developer_CustomerAttributes_Block_Adminhtml_Attributes_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {     protected function _prepareForm()     {         $  form = new Varien_Data_Form(array(             'id' => 'edit_form',             'action' => $  this->getUrl('*/*/save', array('attribute_id' => $  this->getRequest()->getParam('attribute_id'))),             'method' => 'post'         ));         $  form->setUseContainer(true);         $  this->setForm($  form);          return parent::_prepareForm();     } } 
    // Block/Adminhtml/Attributes/Edit/Tabs.php  class Developer_CustomerAttributes_Block_Adminhtml_Attributes_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {     public function __construct()     {         parent::__construct();         $  this->setId('customerattributes_tabs');         $  this->setDestElementId('edit_form');         $  this->setTitle($  this->__('Attribute Information'));     }      protected function _beforeToHtml()     {         $  this->addTab('main_section', array(             'label' => 'Attribute Properties',             'title' => 'Attribute Properties',             'content' => $  this->getLayout()                                ->createBlock('dev_customerattributes/adminhtml_attributes_edit_tab_main')                                ->toHtml()         ));          $  this->addTab('options_section', array(             'label' => 'Attribute Options',             'title' => 'Attribute Options',             'content' => $  this->getLayout()                                ->createBlock('dev_customerattributes/adminhtml_attributes_edit_tab_options')                                ->toHtml()         ));          return parent::_beforeToHtml();     } } 
    // Block/Adminhtml/Attributes/Edit/Tab/Main.php  class Developer_CustomerAttributes_Block_Adminhtml_Attributes_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form {     protected function _prepareForm()     {         $  form = new Varien_Data_Form();         $  this->setForm($  form);         $  fieldset = $  form->addFieldset('todo_form', array('legend' => 'ref info'));          $  fieldset->addField('attribute_code', 'text', array(             'label'    => 'Attribute Code',             'class'    => 'required-entry',             'required' => true,             'name'     => 'attribute_code'         ));          $  fieldset->addField('attribute_label', 'text', array(             'label'    => 'Attribute Label',             'class'    => 'required-entry',             'required' => true,             'name'     => 'attribute_label'         ));          $  fieldset->addField('frontend_label', 'text', array(             'label'    => 'Frontend Label',             'class'    => 'required-entry',             'required' => true,             'name'     => 'frontend_label'         ));          $  fieldset->addField('frontend_input', 'select', array(             'label'    => 'Frontend Input',             'class'    => 'required-entry',             'required' => true,             'name'     => 'frontend_input',             'value'    => 'select',             'values'   => Mage::getModel('eav/adminhtml_system_config_source_inputtype')->toOptionArray()         ));          if (Mage::registry('customer_attribute_data')) {             $  form->setValues(Mage::registry('customer_attribute_data')->getData());         } else {             return parent::_prepareForm();         }     } } 
    // Block/Adminhtml/Attributes/Edit/Tab/Options.php  class Developer_CustomerAttributes_Block_Adminhtml_Attributes_Edit_Tab_Options extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract { } 

Programmatically added block doesn’t appear in block admin page

First of all, this is not a duplicate of this question, as I can’t see my block even though I click Place Block.

Below is my block class. To the best of my knowledge, it should appear in the list, but it doesn’t. What am I doing wrong? There is another block class, and that can be discovered.

<?php  namespace Drupal\tcmb\Plugin\Block;  use Drupal\Core\Block\BlockBase;  /**  * Provides a 'Tcmb Currency' block.  *  * @Block(  *  id = "tcmb_currency_block",  *  admin_label = @Translation("Tcmb: currency"),  *  category = @Translation("Tcmb")  * )  */  /**  * Display TCMB currencies as a block.  */ class TcmbCurrencyBlock extends BlockBase { 

Magento 2 create admin form selected option depend on another selected option

I have created an module for admin which have admin form and this form have some fields.I have two select option drop down fields.If I choose first dropdown option value then second drop-down display some values and if I choose another option then value should be different.

I have search on forums but not found any solution.Please help me.

screenshot are attached.

enter image description here

enter image description here

How do I add an extra “Add content”-link to the admin toolbar dropdown

I am trying to add some improvement to the workflow of the webmasters. Right now they have to click “Content”, and then click once more on the “Add content” button. Since I am working with the “Admin toolbar” module, I want to add a “/node/add” link below the “Content” link in a dropdown. But no success yet.

Windows 2008 R2: Admin user logs out but then when trying to log back in, same admin user name appears with prompt for password

For one of our Windows 2008 R2 servers, a very peculiar issue has appeared.

Using an admin account, I’m able to successfully log out. Then when going back to the server to log in, I’m prompted to press CTRL-ALT-DEL as usual, but instead of being prompted to enter a username and password, my admin account name appears and I’m prompted for just the password.

In other words, it appears that my admin account was never actually logged out, but just “locked” (i.e when user presses WIN key + ‘L’ instead of logging out). However, when remotely checking to see who’s logged into that server using “query user server:[server name]”, it shows that no users are logged in…

Any ideas on what’s causing the previous logged in user to show as still being logged in? The server is patched up currently and appears to operating fine otherwise.

Add routing config via admin UI

I have a Drupal site with a specialised search query page that accepts about a dozen arguments as URL query parameters, most of which are optional.

Simplified routing YML file looks like this:

my_search_results_page.content:   path: '/my-search'   defaults:     _controller: '\Drupal\my_search\Controller\MySearchResultsController::content'     _title: 'Search Results'     location: null     type: 'any'     status: 'any'     filter: 'any'   requirements:     _permission: 'access content'     _access: 'TRUE' 

The url query args location, type, status and filter are passed into the controller along with a bunch of others that I’ve ommitted for brevity. Location is a required field, hence the null default. All of the others are optional, and will get the value any if not specified in the query. This all works perfectly.

Now I have an additional requirement, to be able to create custom SEO-friendly preset URLs for specific search queries. For example, if they want to do a marketing push for widgets in London, they want a URL that looks like /widgets-in-london, which would resolve to a search results page where location is set to London and type is set to Widgets.

This seems like it could be achieved relatively easily by adding an additional routing entry to the my_search.routing.yml file for each preset URL they want, and and some extra code in my controller class to manage it. But the marketing team want to be able to create and edit these URLs on the fly, which makes a code-based solution non-optimal. But I’m at a loss as to how to do it more generally.

Can anyone help me come up with a flexible solution that will allow them to set up custom routes without them having to touch the code.

Thank you.