Categories
CMS Drupal Mastering Development

How to add a field to menus?

I am trying to add an extra text field to the menu entity. At first I tried hook_form_FORM_ID_alter to add the field and used a custom submit handler but didn’t know how to actually get the field data to save. Then I found hook_entity_base_field_info and thought this would be better since it seems like Drupal […]

Categories
CMS Mastering Development Wordpress

publish_{$post_type} hook works only for posts and not for custom post types or pages

I’m trying to send push notification when any of posts, custom post types or pages is published. I’m getting enabled post types from the plugin settings and adding action via foreach loop in my class __construct method. The problem is that it only works for posts and not for any of custom post types or […]

Categories
Mastering Development

How to zip list of numpy arrays

I have a dict of numpy arrays : {‘data1’: array([[0.16461831, 0.82400555], [0.02958593, 0.483629 ], [0.51268564, 0.07030046], [0.17027816, 0.35304705]]), ‘data2’: array([[0.8292598 , 0.78136548], [0.30389913, 0.69250432], [0.66608852, 0.42237639], [0.72678807, 0.40486951]]), ‘data3’: array([[0.45614633, 0.96677904], [0.87066105, 0.75826116], [0.39431988, 0.73041888], [0.65685809, 0.65498308]])} Expected output : [([0.16461831, 0.82400555], [0.8292598 , 0.78136548], [0.45614633, 0.96677904]), ([0.02958593, 0.483629 ], [0.66608852, 0.42237639], [0.87066105, 0.75826116]), ([0.51268564, […]

Categories
Mastering Development

I need to convert latitude and longitude to address from rest api in to a listview

I am fetching the latitude and longitude from rest api and have to convert to address everytime when the list gets loaded, but I am getting ‘Future’ is not a subtype of type ‘String’ Flutter. I have also tried to add FutureBuilder. How to solve this I am newbie to flutter. body: Container( child: Center( […]

Categories
CMS Drupal Mastering Development

How rewrite this module from Drupal 7 to Drupal 8? [closed]

<?php /** * @file * blogs_dynamic_list_terms.module. */ /** * Implements hook_menu(). */ function blogs_dynamic_list_terms_menu() { $items = array(); // Put your menu items here. $items[‘blogs/dynamic-list-terms’] = array( ‘title’ => ‘Dynamic lists terms’, ‘page callback’ => ‘drupal_get_form’, ‘page arguments’ => array(‘blogs_dynamic_list_terms_render_select_list’), ‘access callback’ => TRUE, ‘type’ => MENU_NORMAL_ITEM, ); return $items; } function blogs_dynamic_list_terms_render_select_list($form, &$form_state) { […]

Categories
CMS Magento Mastering Development

magento 2.3 inline edit not working with ID column but working with another column

I have a grid created via ui component and to this grid I added the inlineEdit feature in order to give the user the ability to change the value to one column. The problem is that if I set theentity_id as the indexField, then the inlineEdit is not working: ajax returns the old value instead […]

Categories
CMS Mastering Development Wordpress

Category permalinks don’t work even after flushing

I have created a custom post type (portfolio) and I’m using the built-in Category taxonomy with it. When I view the category archives page, only regular posts are showing under the category, my custom posts aren’t there at all. The options to select categories are there in the Edit Post page (and Quick Edit), they […]

Categories
Mastering Development

How to place google admob ads in between widgets in flutter. When I place some ads I get errors .. Please help me with this

THe error occurs when I want to shift between widgets in the same page and the below error pops up in the debugging console. The Error I get in my degub console E/MethodChannel#flutter/platform_views(12830): Failed to handle method call E/MethodChannel#flutter/platform_views(12830): java.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.Map E/MethodChannel#flutter/platform_views(12830): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.dispose(PlatformViewsChannel.java:113) E/MethodChannel#flutter/platform_views(12830): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:62) E/MethodChannel#flutter/platform_views(12830): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:230) […]

Categories
Mastering Development

How to make this corousel slider clickable in flutter

Here is my code for corousel slider in flutter, i want to make this slides clickable how can i do that? when an image in corousel slider is clicked i want to open screen particular to the image category. class _CarouselExampleState extends State<CarouselExample> { List imgNews = [ "images/groceries.jpg", "images/image_1.png", "images/photographer.jpg", "images/electrician.jpg", ]; @override void […]

Categories
Mastering Development

Thousand seperator in fluter

Is there a way to make a thousand seperator when typing numbers in a TextFormField in flutter? This is my TextFormField child: TextFormField( decoration: InputDecoration( border: const OutlineInputBorder()), keyboardType: TextInputType.number, ),