how to override Custom theme phtml file by custom module

I Want to override this is Current theme path that i want to override. I have a file In


but i want to override in my theme, Path Like :-


here is my xml file :-preview_product_gallery.xml

<?xml version="1.0"?>     <page layout="1column" xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">         <body>             <referenceContainer name="content">                 <referenceBlock name="">                     <action method="setTemplate">                         <argument name="template" xsi:type="string">Vendor_Module::gallery.phtml</argument>                     </action>                 </referenceBlock>             </referenceContainer>         </body>     </page> 

Custom Access check for module route

I’m working on module that should behave as API endpoint.

I created Controller which handler POST & GET requests from external system, but I need to add user authentication so only authenticated user can acccess these endpoints.

My mymodule.routing.yml:

mymodule.show_content:   path: 'api/getContent'   defaults:     _controller: '\Drupal\mymodule\Controller\ContentController::getContent'     _format: hal_json   requirements:     _method: 'POST'     _custom_access_check: 'TRUE' 

My mymodule/src/Access/CustomAccessCheck.php:

class CustomAccessCheck implements AccessInterface {     public function access(AccountInterface $  account)     {         return ($  account->hasPermission('access content')) ? AccessResult::allowed() : AccessResult::forbidden();     } } 


  mymodule.custom_access_check:     class: Drupal\mymodule\Access\CustomAccessCheck     arguments: ['@current_user']     tags:       - { name: access_check, applies_to: _custom_access_check } 

I created a user called REST with REST role. I gave him ‘access content’ permission and tried to make request with Postman using POST method and following headers:

{     Content-Type: application/hal+json,     Authorization: Basic <base64_encoded user:pass>     X-CSRF-Token: token obtained from <page_url>/rest/session/token } 

When I make request with admin user, I see in recent logs, that admin access the route /api/getContent but access was denied. When I use my REST user it logs as anonymous user. Even when I log the status of authentication inside CustomAccessCheck::access function I see that user is authenticated with TRUE

I need to keep this authentication separated (out of controller, in service or something) because I need to authenticate every request (re-use auth) so only internal users can use API (and not everyone with URL). I don’t understand what is missing and why only my admin user is recognized by drupal and the REST user not.

How to reinstall/fix specific perl module on ubuntu 16.04

During an update, apt and dkpg returned the following error:

dpkg: error processing package libperl5.22:amd64 (--configure):  package is in a very bad inconsistent state; you should  reinstall it before attempting configuration Errors were encountered while processing:  libperl5.22:amd64 

When I tried to use the prescribed fix, it returned:

user@Server:/# sudo dpkg --remove --force-remove-reinstreq libperl5.22:amd64 dpkg: dependency problems prevent removal of libperl5.22:amd64:  perl depends on libperl5.22 (= 5.22.1-9ubuntu0.5).  dpkg: error processing package libperl5.22:amd64 (--remove):  dependency problems - not removing Errors were encountered while processing:  libperl5.22:amd64 

I have never encountered this error before, not sure how to proceed.

É possível ter uma configuração de roteamento de telas para cada module com Angular JS ? Se for possível, como fazer o roteamento entre modules?

var app = angular.module("app", ['ngMaterial', 'ui.utils.masks', 'ngMessages', 'toastr', 'ngStorage', 'ui.router']);  app.config(function ($  stateProvider, $  urlRouterProvider) {     $  stateProvider             .state("Servicos", {                 url: "/Servicos",                 templateUrl: 'GED-ME-Tamplates/Servicos.html'             })             .state("Acesso", {                 url: "/Acesso",                 templateUrl: 'GED-ME-Tamplates/Acesso.html',                 controller: 'AcessoCtrl'             })             .state("Cadastro", {                 url: "/Cadastro",                 templateUrl: 'GED-ME-Tamplates/Cadastro.html',                 controller: 'CadastroCtrl'             })             .state("VerificarDoc", {                 url: "/AutenticidadeDeDocumentos",                 templateUrl: 'GED-ME-Tamplates/VerificarDoc.html',                 controller: 'VerificarDocCtrl'             });     $  urlRouterProvider.otherwise("/Servicos"); });  //----------------------------------------------------------------------------//  var appInterno = angular.module("appInterno", ['ngMaterial', 'ui.utils.masks', 'ngMessages', 'toastr', 'ngStorage', 'ui.router']);  appInterno.config(function ($  stateProvider, $  urlRouterProvider) {     $  stateProvider             .state("AreaDoUsuario", {                 templateUrl: 'GED-ME-Tamplates/AreaDoUsuario.html',                 controller: 'AreaDoUsuarioCtrl'             })             .state("DocumentosAassinar", {                 url: "/DocumentosAassinar",                 parent: 'AreaDoUsuario',                 templateUrl: 'GED-ME-Tamplates/DocumentosAassinar.html',                 controller: 'DocumentosAassinarCtrl'             })             .state("Buscar", {                 url: "/Buscar",                 parent: 'AreaDoUsuario',                 templateUrl: 'GED-ME-Tamplates/Buscar.html',                 controller: 'BuscarCtrl'             });     $  urlRouterProvider.otherwise("/404"); }); 

Error using charts module [on hold]

Uncaught ReferenceError: google is not defined at Object.attach (:19:7) at js_N4fLhFjtZJZS4nUHkdvhTjdi62SoNLE_KNAeLAAatNY.js:62 at Array.forEach () at Object.Drupal.attachBehaviors (js_N4fLhFjtZJZS4nUHkdvhTjdi62SoNLE_KNAeLAAatNY.js:59) at HTMLScriptElement. (js_N4fLhFjtZJZS4nUHkdvhTjdi62SoNLE_KNAeLAAatNY.js:3350) at Function.each (js_N4fLhFjtZJZS4nUHkdvhTjdi62SoNLE_KNAeLAAatNY.js:2) at r.fn.init.each (js_N4fLhFjtZJZS4nUHkdvhTjdi62SoNLE_KNAeLAAatNY.js:2) at Drupal.AjaxCommands.insert (js_N4fLhFjtZJZS4nUHkdvhTjdi62SoNLE_KNAeLAAatNY.js:3348) at js_N4fLhFjtZJZS4nUHkdvhTjdi62SoNLE_KNAeLAAatNY.js:3229 at Array.forEach ()

I am using drupal 8.6 and also tried doing composer install but still the same error persists.