database – how to convert a timestamp to a date format in the Drupal 8 custom module

I created a custom module and printed this result in .csv format

Ea Iustum Jus,Fifa,example@asdf.wer,1573924224,

How to convert this timestamp to a date format?
I have tried 2 options in mymodulecontroller.php:

1.$select->addField('c','created',"DATE_FORMAT(FROM_UNIXTIME(created), '%d.%m.%Y %H:%i'");
2$select->addField('c', 'created', date('m-d-Y',$select));

This is what mymodulecontroller.php looks like

addField('c', 'created');
namespace DrupalmymodulelistController;
use DrupalCoreControllerControllerBase;
use DrupalCoreDatabaseDatabase;
use SymfonyComponentHttpFoundationResponse;
* Controller for mymodule List Report in .CSV
class DownloadCSVController extends ControllerBase {
* Gets all mymodules List for all nodes.
* @return array
protected function load() {
$select = Database::getConnection()->select('mymodulelist', 'r');
// Join the users table, so we can get the entry creator's username.
$select->join('users_field_data', 'u', 'r.uid = u.uid');
// Join the node table, so we can get the event's name.
$select->join('node_field_data', 'n', 'r.nid = n.nid');
// Select these specific fields for the output.
$select->join('mymodulelist', 'r', 'r.mail = r.mail');
// Select these specific fields for the output.
$select->join('mymodulelist', 'c', 'r.created = c.created');
// Select these specific fields for the output.
$select->addField('n', 'title');
$select->addField('u', 'name', 'username');
$select->addField('r', 'mail');
// how to create a date format from unix timestamp to d-m-Y for the field created ??
$select->addField('c', 'created');
// I tried this 2 options
// 1. $select->addField('c', 'created',"DATE_FORMAT(FROM_UNIXTIME(created), '%d.%m.%Y %H:%i'");
// 2. $select->addField('c', 'created', date('m-d-Y',$select));
$entries = $select->execute()->fetchAll(PDO::FETCH_ASSOC);
return $entries;

update with solution:

How to create a date format from a Unix timestamp to d-m-Y for a field
yourDBcolumn_formatted must be dotted like this c.

$select->addExpression("DATE_FORMAT(FROM_UNIXTIME(yourDBcolumn), '%d.%M.%Y')", 'c.yourDBcolumn_formatted');

magento2 – Adding custom settings to the ajax URL, from the problem of the admin grid lines

I am on the editing page with the following URL:


where I loaded a custom grid. When I want to edit the price column and press the save button, I would like to pass to the URL ajax an additional parameter, from the component of the XML user interface.

enter the description of the image here

That's what I tried:

                custom name
                        {i would like here to include the shippingmethod_id value from my edit page url}

in the I can include static values ​​(and it works), but I would like to include the value of the shippingmethod_id from the URL of the editing page. Is it possible ? 🙂


get the value of the custom property using the search query

How can I get the value of the property bag using the restAPI search query.
I've tried to index the bag of properties and start the analysis:


and when to try:

web.IndexedPropertyKey | Format-List

I see the property "sitetitlelabelkey" as indexed in the search.

But I could not find the search shema. unmanaged property or analyzed property.
and when running the search query:

I found the value of my property bag linked to the key "HitHighlightedSummary", but not for all sites and even has a value rong for some sites, the key is like this or contains another text.
enter the description of the image here

So, how can I get the value of my web property bag using a search query? I use RESTAPI.

sharepoint enterprise – Wondering if a custom list filter helps solve the view threshold problem 5000

Is the 5000 View Threshold a server-side or client-side problem? In other words, would I waste my time creating a custom client-side "view filter" from the Allitems list, who will still process the 5000 filter, then? I'm trying to filter through FY and the OOB view filter does not allow me to do it. So I think to create a custom.

nginx – View other publications on the custom publication type page

I am faced with a very strange problem. Speaker is a type of custom message and a taxonomy. Target shows all speakers which taxonomy is also an orator.

When I load / the speakers page, she posts general blog posts. Moreover, the model is not identical to archive-speaker.php. I have created another type of custom message for the test, which works well. Only problem with the type of personalized message of the speaker. He was working on another Nginx server. After cloning the site on the new nginx server, I see this problem.

My all configurations and tests:

register_post_type('speaker', array(
    'labels' => array(
        'name' => __('People', 'dxef'),
        'singular_name' => __('People', 'dxef'),
        'add_new' => __('Add New', 'dxef'),
        'add_new_item' => __('Add New Person', 'dxef'),
        'edit_item' => __('Edit Person', 'dxef'),
        'new_item' => __('New Person', 'dxef'),
        'all_items' => __('All People', 'dxef'),
        'view_item' => __('View Person', 'dxef'),
        'search_items' => __('Search People', 'dxef'),
        'not_found' => __('No People found', 'dxef'),
        'not_found_in_trash' => __('No People found in trash', 'dxef'),
        'menu_name' => __('People', 'dxef')
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true,
    'show_in_menu' => true,
    'query_var' => true,
    'rewrite' => array(
        'slug' => 'speakers',
        'with_front' => false
    'capability_type' => 'post',
    'has_archive' => true,
    'hierarchical' => true,
    'menu_position' => 5,
    'supports' => array(

Loading taxes related to taxonomy

add_action( 'pre_get_posts', 'speaker_archive' );

function speaker_archive( $query ) {

    if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'speaker' ) ) {

        $query->set( 'posts_per_page', '30' );

        $taxquery = array(
            array (
                'taxonomy' => 'roles',
                'field' => 'slug',
                'terms' => 'speaker',
                'operator' => 'IN'

        $query->set( 'tax_query', $taxquery );



The code above is no longer called. is_post_type_archive( 'speaker' ) false returns on /speakers page. I've emptied the rewrite rule by recording permalinks. But that does not solve my problem.

I guess before calling the custom message type, the general blog message is called. But I do not know how to detect why this happens and what is the real solution.

html – How can I add custom headers and links to my website from my website?

I am currently using a .html document that I visualize with chrome.
Currently, I code links hard but I want to be able to easily add a link and headers to the page. Below is an example of the current code I use. Thank you in advance for your help.




Duck Duck Go

Magento 2: add a custom phtml sidebar to the home page

I want to add a custom sidebar phtml file in the home page that would indicate specific categories. I could not find a specific layout or template file for the home page. ideas?

php – WooCommerce: How to add a custom type product (yith composite) to the cart

I'm building a mobile app and I need to add products with ajax queries.

My client uses a custom product type called yith-composite that converts products to parent and children (component)

Like a car (parent) and wheels (component)

My problem that adds button (ajax) and wx-ajax = add_to_cart does not work with this type of product,

Adding to the cart only works properly if I've disabled ajax and let it submit the form, then refresh it.

Once viewed, the data on the application form was as follows:

ywcp_selection(153CE4EE-C1A0-6D39-9AD5-58B51C5AB306): -1
attribute_pa_sphere: 7-50
ywcp_variation_id(153CE4EE-C1A0-6D39-9AD5-58B51C5AB306): 124138
ywcp_quantity(153CE4EE-C1A0-6D39-9AD5-58B51C5AB306): 1
ywcp_selected_product_value(153CE4EE-C1A0-6D39-9AD5-58B51C5AB306): 102523
ywcp_selection(471BAD03-9C3B-B44E-8584-348A5F33F8A6): -1
attribute_pa_sphere: 7-00
ywcp_variation_id(471BAD03-9C3B-B44E-8584-348A5F33F8A6): 110356
ywcp_quantity(471BAD03-9C3B-B44E-8584-348A5F33F8A6): 1
ywcp_selected_product_value(471BAD03-9C3B-B44E-8584-348A5F33F8A6): 102552
quantity: 1
add-to-cart: 102491

So my question is how to change the default value of wc-ajax = add_to_cart to accept this type of new data? and adding the product correctly to the basket?

theme development – Assign custom classes to divs inside the loop

I use this beautiful effect to replace a slider that was part of a custom theme that I created. I need a way to implement a custom CSS class for each div who will be in the wordpress loop, I want to use a custom publication type that I've already registered to dynamically put the images into the tags, in the old version of my code, I used alsto this plugin to add a selected secondary image for mobile only get_posts() instead of the standard loop, see the link for more information. How can I get there?

This is the code that I use without the loop for the moment:



Lorem ipsum


As you can see to get the effect I need to assign to boot columns a different class in my case img-top and img-middle. Using the loop will make this impossible and I want to avoid images being hard-coded inside the php file.

sharepoint online – Custom List – Edit Article

I created a custom list,
01. Team – users have "Contribute only without editing or deleting",
02. Team – a "Contribute without deleting"

But the 2nd team can not edit the item in the list, but the option is enabled, but when you click Edit, the content is not displayed for editing, only the title is displayed.

I saw this, there is no editing content in "Default Edit Form", refer to the attached image, how to restore the form from previous edition. enter the description of the image here