Products in cart reports magnto2 backend

When i go to reports -> products in cart i am getting price 0 and product name blank.

enter image description here

uicomponent – Add link and to backend modal and pass values to controller

I have a PrintButton on the backend which links me to a controller. This button should open a modal with a radioset of buttons and pass this to the controller.

The xml of the backend page:

<argument name="data" xsi:type="array">
    ...
    <item name="buttons" xsi:type="array">
        <item name="back" xsi:type="array">
            <item name="name" xsi:type="string">back</item>
            <item name="label" xsi:type="string" translate="true">Back</item>
            <item name="class" xsi:type="string">back</item>
            <item name="url" xsi:type="string">*/*/index</item>
        </item>
        <item name="delete" xsi:type="string">VendorModuleBlockAdminhtmlResultCodeDeleteButton</item>
        <item name="export" xsi:type="string">VendorModuleBlockAdminhtmlResultCodeExportButton</item>
        // This is my button /
        <item name="print" xsi:type="string">VendorModuleBlockAdminhtmlResultCodePrintButton</item>
    </item>
</argument>

My PrintButton.php:

class PrintButton extends GenericButton implements ButtonProviderInterface
{
    /**
     * Get button data
     * @return array
     */
    public function getButtonData()
    {
        $data = ();
        $codeSetId = $this->getCodeSetId();

        if ($codeSetId && $this->canRender('print')) {
            $data = (
                'label' => __('Print'),
                'id' => 'print',
                'class' => 'primary print',
                'data_attribute' => (
                    'mage-init' => (
                        'Magento_Ui/js/form/button-adapter' => (
                            'actions' => (
                                (
                                    'targetName' => 'vendor_resultcode_codes_grid.vendos_resultcode_codes_grid.print_modal',
                                    'actionName' => 'toggleModal',
                                    'params' => (
                                        $this->getPrintUrl($codeSetId),
                                    ),
                                )
                            )
                        )
                    )
                ),
                'on_click' => '',
                'sort_order' => 10,
            );
        }
        return $data;
    }
}

Before on_click looked like this:

'on_click' => 'setLocation('' . $this->getPrintUrl($codeSetId) . '')',

The Modal in my xml:

<modal name="print_modal">
        <settings>
            <options>
                <option name="buttons" xsi:type="array">
                    <item name="0" xsi:type="array">
                        <item name="text" xsi:type="string">Done</item>
                        <item name="class" xsi:type="string">action-primary</item>
                        <item name="actions" xsi:type="array">
                            <item name="0" xsi:type="array">
                                <item name="targetName" xsi:type="string">${ $.name }</item>
                                <item name="actionName" xsi:type="string">actionDone</item>
                            </item>
                        </item>
                    </item>
                </option>
                <option name="title" translate="true" xsi:type="string">Choose how often to print each label</option>
            </options>
            <onCancel>actionCancel</onCancel>
        </settings>
        <fieldset name="general" sortOrder="10">
            <settings>
                <label/>
            </settings>
            <radioset name="radioset_print">
                <settings>
                    <label translate="true">Choose how often to print each label</label>
                    <validation>
                        <rule name="required-entry" xsi:type="boolean">true</rule>
                    </validation>
                    <options>
                        <option name="0" xsi:type="array">
                            <item name="value" xsi:type="number">1</item>
                            <item name="label" xsi:type="string">1x</item>
                        </option>
                        <option name="1" xsi:type="array">
                            <item name="value" xsi:type="number">2</item>
                            <item name="label" xsi:type="string">2x</item>
                        </option>
                        <option name="2" xsi:type="array">
                            <item name="value" xsi:type="number">3</item>
                            <item name="label" xsi:type="string">3x</item>
                        </option>
                        <option name="3" xsi:type="array">
                            <item name="value" xsi:type="number">4</item>
                            <item name="label" xsi:type="string">4x</item>
                        </option>
                        <option name="4" xsi:type="array">
                            <item name="value" xsi:type="number">5</item>
                            <item name="label" xsi:type="string">5x</item>
                        </option>
                    </options>
                </settings>
            </radioset>
        </fieldset>
    </modal>

So how exactly can I pass my values to the controller and also make my “Done” button execute the previous on_click value?

architecture – Multi-Tenant SAAS application with common backend for Mobile App and Front End Dashboard App

I have a requirement for a Mobile App to be able to write to a database managed by a backend. I will also have an admin dashboard that would retrieve data from the database, have analytics performed by the backend and present it to the View. The Front-end dashboard and the mobile app will not share any data between them and hence they need not be synchronized though I am open to suggestions here as-well. In a nutshell,

  1. The Mobile App writes to the database. Data will be JSON string.

  2. The Web App pulls data from the database and presents it to the dashboard. The Back-end will need to manage that analytics portion and paint the Front end dashboard.

  3. In addition, the backend will also need to create external notifications for SMS/Slack/Email(POP).

  4. Lastly, I also want to keep this entire application multi-tenant supporting multiple clients. Under each client there will be only one user.

As a first time Web App developer, My question is how would I go about architecting the APIs so that I don’t have a lot of duplicated code and achieve a clean architecure .I have heard of the Separation of concerns. I just don’t know how to apply that in this context.

Multi-Tenant SAAS

load balancing – How can I get haproxy to fail over to another backend?

TLDR: What changes should I make to my HAProxy config to ensure that requests fail over to a working backend when a server goes down?

This seems like a simple question and may be a duplicate, but everything I’ve found online isn’t working and I may be having difficulty formulating the question so I can find relevant results…

I’ve been following this tutorial for my setup.

I’m putting together an application with several (identical, stateless) API applications running in Docker containers with an HAProxy load balancer in front. The HAProxy config is below:

global
    maxconn 4096
    daemon

defaults
    log     global
    mode    http

frontend api_gateway
    bind 0.0.0.0:80
    default_backend api_backend

backend api_backend
    balance roundrobin
    option httpchk GET /check # returns status 200 and text "OK" if server is up
    option redispatch
    server apiservice_1 192.168.xxx.yyy:61001 check inter 2s downinter 5s fall 1 rise 2 observe layer4 error-limit 1 on-error mark-down
    server apiservice_2 192.168.xxx.yyy:61002 check inter 2s downinter 5s fall 1 rise 2 observe layer4 error-limit 1 on-error mark-down

I’m trying to write an automated deployment script that will take down one API server at a time & update it with zero downtime. I set up my servers and the haproxy container and I’m using wget to monitor the requests every second using watch. I’m stopping & starting the backends to test the proxy’s behaviour.

The problem I’m finding is that occasionally the proxy will send back a 502 Bad Gateway if I hit the gateway as the server is going down. It’s not hard to do this – I just have to time it right.

It seems to me that it should be possible to configure the proxy to try a different backend without rejecting the request if the first backend it tries fails. But I cannot get this to work.

From my reading of the documentation for option redispatch it sounds like this is the option that should handle it. But I should note that I’m using a bearer token for authentication and not using cookies, which may mean that this option does not apply?

The other point that may be giving me problems with the notion of what it means for the server to be down. Much of the documentation I read for various options seems to reply on HTTP status codes to determine if the backend is down – what happens when the backend is just unresponsive? It seems to me that an unresponsive server is the paradigm case of “server down”, but I’m finding the documentation to be a bit unclear on this.

javascript – Como pegar uma informação do backend no frontend?

Eu estou no front-end e quero pegar uma informação que está no back-end, como faço isso?

MS Access Front End with SQL Server Express Backend – Still A Good Idea?

I’m with a company for a short time and I’ve been tasked with making database applications for handling some of their internal processes. I’m creating the databases in Microsoft Access as the company already has Office 365 licences, and since I’m only working here for a few months, I don’t want to leave them with a database too complex for them to maintain (some people here have a bit of experience with Access). That being said, I’m considering switching the backend to SQL Server Express rather than an Access backend as I’ve been having some network disruption issues, and I don’t want to worry about the backend corrupting (Especially once I’m gone). Additionally these databases may have a few users on them at once and I know Access isn’t the best for multi-user use.

I know a lot of people cringe at the idea of creating a database in Access today, but is it still considered good practice to use MS Access as a front end user application, and SQL Server Express as the backend for housing the data? Ideally after I leave the databases won’t need much maintenance or have many issues. Does SQL Server require a lot of regular maintenance or can it more or less be left on its own after the database has been developed.

I’m also open to other suggestions anyone has for a backend solution.

plugins – Disabling Wp_is_mobile from backend?

I’m using a wordpress theme that makes use of wp_is_mobile function, but reacts badly on many occasion,
as it’s being called in many files, I was wondering if you are aware of a wordpress plugin that would maybe ‘disable’ that functionnality or pretend we’re never on mobile ?

Thank you!

How to configure nginx to retry connections to its backend

I have nginx with nodejs back-end.

From time to time the back-end blocks for less than 1 sec. If I immediately do new request I receive correct page.

this is from the log:

2020/06/22 08:11:34 (error) 61280#61280: *437325287 connect() failed (111: Connection refused) while connecting to upstream, client: MYIP, server: MY.SERVER, request: "GET /api/admin/ HTTP/1.1", upstream: "http://127.0.0.1:2000/api/admin/", host: "MYHOST", referrer: "https://MYREFERER/admin"

nginx conf look like this:

upstream backend {
    server 127.0.0.0:2000;
}

I understand what the error means.

Is there a way nginx to retry the connection if connection is refused?

development process – How to choose the proper backend framework for my webapp

As said in the title I’m searching an help choosing the best framework for my webapp.

My application is an editor that helps user “editing” a 20-30MB multidimensional array.

It is easy to do that, the problem is everytime the user do a single edit the array must be synced with the server without sending 20MB of json text each time.

For example:

I developed something in past using blazor and the result was really “MEH”. So, I decided to start from scratch, choose a good framework and learn all I should learn.

So, here we come to the final question. There are a lot of frameworks and I really don’t know where to start, what to choose. As a newbie I’m totally lost and I don’t want to waste time learning something that doesn’t really fit for my project.

¿Cómo crear un contenedor en docker que contenga el frontend y el backend de un proyecto con laravel (backend) y angular (frontend)?

Hola quiero crear un contenedor en docker con la siguiente estructura:

Directorio Principal
-backend (LAMP Stack + laravel 7)
-frontend (MEAN Stack con Angular 9 + MySQL)
-docker
-php
-php.ini
-apache
-apache2.conf
-vhost.conf

Con una imagen de base de datos MySQL que se pueda compartir con varios contenedores.

Tengo creado un contenedor con LAMP Stack y una imagen de composer funcional, pero no sé cómo hacer funcionar laravel dentro del contenedor.

A continuación muestro el código funcional que tengo del Dockerfile y docker-compose:

Dockerfile:

FROM php:7.4-apache
LABEL maintainer="ruben"
RUN a2enmod rewrite
RUN apt-get update
RUN apt-get update && apt-get install -y 
        libzip-dev 
        libicu-dev 
        libxml2-dev 
        libpq-dev 
        vim 
        curl 
        git 
        supervisor 
        zip 
        unzip 
        && docker-php-ext-install pdo_mysql zip intl xmlrpc soap opcache 
        && docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd

RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -- 
        && apt-get install -y nodejs 
        && apt-get autoremove -y

COPY --from=composer /usr/bin/composer /usr/bin/composer
#COPY docker/php/php.ini /usr/local/etc/php/
#COPY docker/apache/vhost.conf /etc/apache2/sites-available/000-default.conf
#COPY docker/apache/apache2.conf /etc/apache2/apache2.conf

# Suppress the do-not-run-as-root warning from composer
ENV COMPOSER_ALLOW_SUPERUSER 1
COPY . /var/www/html/

docker-compose.yml:

version: "3"
services:
    app:
        image: lamp-img
        container_name: lamp-cont
        build: ./
        restart: always
        ports:
            - "81:80"
        volumes:
            - .:/var/www/html
    myadmin:
        image: phpmyadmin/phpmyadmin
        container_name: phpmyadmin
        restart: always
        depends_on: 
            - mysql
        ports:
            - "82:80"
        links:
            - mysql:db
    mysql:
        container_name: mysql
        image: mysql:8.0
        restart: always
        ports:
            - "83:3306"
        volumes:
            - mysql:/var/lib/mysql
        environment: 
            MYSQL_HOST: 0.0.0.0
            MYSQL_ROOT_PASSWORD: v4n3rub3
volumes:
    mysql:
        driver: "local"

De antemano agradezco toda la ayuda que me puedan dar

Saludos cordiales