Strange behavior of symfony doctrine during phpunit test – field becomes null in database

I am using

  • Symfony v6.4.8
  • doctrine/orm 2.19.5
  • phpunit/phpunit 9.6.19

I have build an REST API GET endpoint /api/contract/{$id} in Symfony.

It performs an API request at another system, receiving that data and combining it with local database data and creates a new record in my database.

The problem I have is at / after the persist()/flush() in the Database, that sometimes the field $contract->eup is NULL in the database.

eup is defined as nvarchar(10) in a MSSQL database.

private function saveContract(EntityManager $em, array $data): ContractData
{        
    $contract = new ContractData();
    // [... some more variables]
    $contract->setEup($data['eup']);  // example: "2024-06-29"
    
    $em->persist($contract);
    $em->flush();

    return $contract;
}

When I call my API with Postman, the record is created correctly and the eup field in the database is filled with a string.

But when I run the phpunit test php bin/phpunit --filter myTest, it calls the api, the record is created in the database, but the eup field is NULL.

  • Other fields of this record are stored correctly at the test.

  • It is also possible to write the value of this field to other fields.

  • Also tried to a shorter string, but this is also not saved.

  • I have run the test with xdebug too and can confirm (together with my colleague) that $contract->eup is set and filled with a string at $em->persist($contract); but when we look after flush at the database SELECT * FROM ... the field eup is NULL.

Do you have an idea what could be wrong?

Target class [customerauth] does not exist

My class CustomerAuth does not exist. I verified namespace and I added that middleware in kernel.php also, but Y im facing the error like
Target class [customerauth] does not exist.

And, use IlluminateSupportFacadesView; this view file is not working properly. Is this have any issue for my error.

i need to troubleshoot this error.

MongoDB: Not authorized on mongodb database to execute command grantRolesToUser() on LIVE server, but works fine in local machine

1. Scenario:-

I have a main database- say portal_mongodb. Under portal_mongodb, I have a user portal_mongodba with role permission {'role': 'dbOwner', 'db' : portal_mongodb}

My env setup is this:-

MONGODB_CONNECTION=mongodb
MONGODB_HOST=localhost
MONGODB_PORT=27017
MONGODB_DATABASE=portal_mongodb
MONGODB_USERNAME=portal_mongodba
MONGODB_PASSWORD=portal_password
MONGODB_MASTER_DATABASE=portal_mongodb

I want to create new database dynamically, but don’t want to create any user for them. I want to give/grant the existing user portal_mongodba the new roles like this:-

[
    {role: 'dbOwner', db: 'new_db'}, 
    {role: 'readWrite', db: 'new_db'}, 
    {role: 'dbAdmin', db: 'new_db'}
]

where new_db is the new dynamically created database.

This is my code in PHP:-

$connectionString = 'mongodb://' . env('MONGODB_USERNAME') . ':' . env('MONGODB_PASSWORD') . '@' . env('MONGODB_HOST') . ':' . env('MONGODB_PORT') . '/?authSource=' . env('MONGODB_DATABASE');
                      
$client             = new MongoClient($connectionString);   // Connect to MongoDB server
$database           = $client->$databaseName;               // setting new database;
$manager            = new MongoManager($connectionString);  // setting mongodb manager to execute command 
$command            = array(
                        'grantRolesToUser'  => env('MONGODB_USERNAME'),
                        'roles'             => array(
                                                array(
                                                    'role'  => 'dbAdmin',
                                                    'db'    => $databaseName
                                                ),
                                                array(
                                                    'role'  => 'readWrite',
                                                    'db'    => $databaseName
                                                ),
                                                array(
                                                    'role'  => 'dbOwner',
                                                    'db'    => $databaseName
                                                )
                                            )
                    );  // command structure to grant role to existing user
$manager->executeCommand(env('MONGODB_DATABASE'), new MongoCommand($command));  // execute command to grant role
$database->$collectionName->insertOne(array('key' => 'value'));                 // Insert a document into a collection

2. How I created database and user in Live server:-

I created it via mongoshell. Here are the commands:-

1. Select admin DB:-

use admin

2. Create a new user under admin DB:-

db.createUser({user: "portalAdmin", pwd: "portalAdminPassword", 
  roles: [
    { role:"userAdminAnyDatabase", db: "admin"}, 
    {role: "root", db: "admin"}
  ]
})

3. create a new db:-

use lppportal_mongodb

4. Authenticate portalAdmin before creating user

db.auth( "portalAdmin", "portalAdminPassword" )

5 create portal user

db.createUser({user: "portal_mongodba", pwd: "portal_password",
   roles: [{ role: "dbOwner", db: "portal_mongodb"}]}
)

3. How I created the local db:-

From mongoDB compass,

1. Created database

use portal_mongodb

2. Created portal user

db.createUser({user: "portal_mongodba", pwd: "portal_password",  
   roles: [{ role: "dbOwner", db: "portal_mongodb"}]
})

4. Issue:-

The above code runs perfectly well in Local development machine, but not in server. But that shouldn’t be the case. Both the local user setup and server user setup are same. Here are the details-

A. LIVE Server Data:-

MongoDB user structure

[
  {
    _id: 'portal_mongodb.portal_mongodba',
    userId: UUID('8aa75c1c-e616-403e-a5e9-0bc260abc3b6'),
    user: 'portal_mongodba',
    db: 'portal_mongodb',
    roles: [
      {
        role: 'dbOwner',
        db: 'portal_mongodb'
      }
    ],
    mechanisms: [
      'SCRAM-SHA-1',
      'SCRAM-SHA-256'
    ]
  }
]

env data

MONGODB_CONNECTION=mongodb
MONGODB_HOST=localhost
MONGODB_PORT=27017
MONGODB_DATABASE=portal_mongodb
MONGODB_USERNAME=portal_mongodba
MONGODB_PASSWORD=portal_password
MONGODB_MASTER_DATABASE=portal_mongodb

B. Local Server Data

MongoDB user structure

[
  {
    _id: 'portal_mongodb.portal_mongodba',
    userId: UUID('9a95223e-393c-4c40-acca-4e3e46ee98b0'),
    user: 'portal_mongodba',
    db: 'portal_mongodb',
    roles: [
      {
        role: 'dbOwner',
        db: 'portal_mongodb'
      }
    ],
    mechanisms: [
      'SCRAM-SHA-1',
      'SCRAM-SHA-256'
    ]
  }
]

env data

MONGODB_CONNECTION=mongodb
MONGODB_HOST=localhost
MONGODB_PORT=27017
MONGODB_DATABASE=portal_mongodb
MONGODB_USERNAME=portal_mongodba
MONGODB_PASSWORD=portal_password
MONGODB_MASTER_DATABASE=portal_mongodb

So basically both the env files, user structure are same.

5. Error Message:-

Error Message:- not authorized on portal_mongodb to execute command { grantRolesToUser: "portal_mongodba", roles: [ { role: "dbAdmin", db: "little_buds" }, { role: "readWrite", db: "little_buds" }, { role: "dbOwner", db: "little_buds" } ], $db: "portal_mongodb", lsid: { id: UUID("fd6bb158-f8bb-4eb8-8f45-c79667f66cc2") } }

How can I fix this?

WooCommerce attributes not inserting into the product

The data is in a strange way, where it just checks if the product name is the same while going through the items in the JSON, and if it does, it adds the attributes of that item to the product with the same name. But right now it only shows the last attributes added in WooCommerce.

Imagine one of the items has two attributes, color and grade, and they’re Red and Grade A, and then another item afterwards that has the same name as the first one, but different color and grade, like Yellow and Grade B, so its the same product, but different variation, but for some reason only the last variation attributes go through to WooCommerce.

function insert_product_attributes($post_id, $available_attributes, $variations) {
    $existing_attributes = get_post_meta($post_id, '_product_attributes', true);
    error_log('existing attributes for the product ' . get_the_title($post_id) . ' : ' . print_r($existing_attributes, true));

    if (!$existing_attributes) {
        $existing_attributes = array();
    }

    $attribute_values = array();

    foreach ($available_attributes as $attribute) {
        $values = array();

        foreach ($variations as $variation) {
            $attribute_keys = array_keys($variation['attributes']);

            foreach ($attribute_keys as $key) {
                if ($key === $attribute) {
                    $values[] = $variation['attributes'][$key];
                }
            }
        }
        $values = array_unique($values);
        $attribute_values[$attribute] = $values;

        wp_set_object_terms($post_id, $values, 'pa_' . sanitize_title($attribute));
    }

    $product_attributes_data = array();

    foreach ($available_attributes as $attribute) {
        $attribute_name = 'pa_' . sanitize_title($attribute);
        $existing_values = array();

        if (isset($existing_attributes[$attribute_name])) {
            if (!empty($existing_attributes[$attribute_name]['value'])) {
                $existing_values = explode(' | ', $existing_attributes[$attribute_name]['value']);
            }
        }

        $all_values = array_unique(array_merge($existing_values, $attribute_values[$attribute]));
        error_log('all attributes: ' . print_r($all_values, true));

        $product_attributes_data[$attribute_name] = array(
            'name' => $attribute_name,
            'value' => implode(' | ', $all_values),
            'is_visible' => '1',
            'is_variation' => '1',
            'is_taxonomy' => '1'
        );
    }

    update_post_meta($post_id, '_product_attributes', $product_attributes_data);
}

Xampp Php Informix jdbc

I need help to get result from informix server through xampp.

I installed Xampp 3.3.0 on windows 11.
I used
$conn= osbc_connect (DSN, username, password);
and also used
$dbo = new pdo (odbc:dsnname,username, password)
to connect sucessfully with our informix server.

It’s very slow and showing result very late.

On otherhand I am also using razorsql and connect informix via jdbc driver. It’s processing queries very fast and showing result quickly.

Now my question is

  1. Is there any connection string for jdbc and how (i didn’t install Jdk but installed jre)
  2. Is there any other connection method for connecting informix server for fast result.

odbc connection worked
But I want jdbc or any other fast connection setting.

sp-api Sync inventory to Amazon

Which API in the sp-api document can synchronize inventory to Amazon? Is there any risk? I use PHP to develop. I have obtained the accessToken. But I don’t know which API to call to synchronize and update the inventory of the Amazon store. I hope to get a reply. Thank you for your reply.

I hope to synchronize the product inventory in ERP to the Amazon store.

WordPress AJAX POST Request Not Working: Page Refreshes Instead of Displaying Result in Modal

I’ve created an AJAX function in WordPress to send a POST request and display the result in a modal upon successful completion, without refreshing the page. However, the AJAX code isn’t working. When I click the button, the page refreshes instead of showing the result in the modal. I’m writing my code in the functions.php file.

I implemented an AJAX function in WordPress to send a POST request. I expected the result to be displayed in a modal upon successful completion, without refreshing the page.

//add API 
function enqueue_custom_scripts() {
    wp_enqueue_script('jquery');
   wp_enqueue_script('bootstrap-popper', 'https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js', array('jquery'), null, true);
  wp_enqueue_script('bootstrap-js', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js', array('jquery'), null, true);
   
    wp_enqueue_script('custom-ajax', 'https://cdnjs.cloudflare.com/ajax/libs/custom-elements/1.6.0/custom-elements.min.js', array('jquery'), null, true);
}
add_action('wp_enqueue_scripts', 'enqueue_custom_scripts');

//function add_enqueue_JS(){
//      wp_enqueue_script('API_SRTB_Voyage', get_stylesheet_directory_uri().'/assets/js/custom.js', array('jquery'));
//}
//add_action('wp_enqueue_scripts', 'add_enqueue_JS');



function display_voyage_form() {
ob_start();

// Fetch data from the API
$ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:8000/api/post/planificationVoyage');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: Bearer mytoken';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);

$response = json_decode($result, true);


?>
<form id="voyageForms"  method="post" style="width: 80vh; margin-top: -25%;">
    <select name="LIGNE_VOY" class="form-control " id="LIGNE_VOY">
        <option value="">Select Line</option>
        <?php
            if (isset($response['data']) && is_array($response['data'])) {
                foreach ($response['data'] as $model) {
                    echo '<option value="' . $model['TRLI_UID'] . '">' . $model['TRLI_DES_LN3'] . ' </option>';
                }
            }
            ?>
    </select>
    
    <input type="date" class="form-control mt-2" id="DAT_VOY" name="DAT_VOY"  />

    <select name="SENS_VOY" id="SENS_VOY" class="form-control  mt-2" required>
        <option value="A">Aller</option>
        <option value="R">Retour</option>
    </select>

    <button name="SubmitButton" type="submit" class="btn  mt-2" style="width: 30vh; background-color: #f15a2d;">Send Request</button>

</form>

<script>
jQuery(document).ready(function($) {
    $('#voyageForms').on('submit', function(event) {
        event.preventDefault();
        var formData = $(this).serialize();
        console.log(formData);
        $.ajax({
            url: '<?php echo esc_url( admin_url("admin-ajax.php") ); ?>',
            type: 'POST',
            data: {
                action: 'submit_voyage_form',
                form_data: formData
            },
            success: function(response) {
                if (response.success) {
                    var tableBody = $("#tableBody");
                    tableBody.empty();
                    var data = response.data;
                    data.forEach(function(row, index) {
                        tableBody.append("<tr><td>" + row.DISTANCE_KM +
                            "</td><td>" + row.DUREE + "</td><td>" + row.HEURE_DEPART +
                            "</td><td>" + row.ARRIVEE + "</td><td>" + row.DEPART +
                            "</td><td>" + (index + 1) + "</td></tr>");
                    });
                    $("#resultModal").modal("show");
                } else {
                    alert('Error: ' + response.data);
                }
            }
        });
    });
});

</script>






<div class="modal fade" id="resultModal" tabindex="-1" role="dialog" aria-labelledby="modalTitle" aria-hidden="false">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header modal-header-center">
                <h5 class="modal-title text-center " id="modalTitle">بيانات الرحلات</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" id="modalBody">
                <table class="table">
                    <thead>
                        <tr>
                            <th scope="col text-end">المسافة</th>
                            <th scope="col text-end">مدة الرحلة</th>
                            <th scope="col text-end">وقت المغادرة</th>
                            <th scope="col text-end">الوصول الى</th>
                            <th scope="col text-end">الانطلاق من</th>
                            <th scope="col">#</th>
                        </tr>
                    </thead>
                    <tbody id="tableBody">
                        <!-- Dynamic rows will be inserted here -->
                    </tbody>
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary text-white" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>





<?php

    return ob_get_clean();
}
add_shortcode('voyage_form', 'display_voyage_form');

// Handle form submission via AJAX
function handle_voyage_form_submission() {
    parse_str($_POST['form_data'], $form_data);

    $SENS_VOY = $form_data['SENS_VOY'];
    $DAT_VOY = $form_data['DAT_VOY'];
    $LIGNE_VOY = $form_data['LIGNE_VOY'];

    if (empty($SENS_VOY) || empty($DAT_VOY) || empty($LIGNE_VOY)) {
        wp_send_json_error('Error, you should select all inputs');
    }

    $date = date("d-m-Y", strtotime($DAT_VOY));

    $ch = curl_init();

    $data = [
        'SENS_VOY' => $SENS_VOY,
        'DAT_VOY' => $date,
        'LIGNE_VOY' => $LIGNE_VOY
    ];

    $dataJson = json_encode($data);

    curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:8000/api/post/planificationVoyage');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $dataJson);

    $headers = array();
    $headers[] = 'Content-Type: application/json';
    $headers[] = 'Authorization: Bearer mytoken';

    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $result = curl_exec($ch);
    if (curl_errno($ch)) {
        wp_send_json_error('Error:' . curl_error($ch));
    }
    curl_close($ch);

    $response = json_decode($result, true);

    if (isset($response['data'])) {
        wp_send_json_success($response['data']);
    } else {
        wp_send_json_error('No data found');
    }
}
add_action('wp_ajax_submit_voyage_form', 'handle_voyage_form_submission');
add_action('wp_ajax_nopriv_submit_voyage_form', 'handle_voyage_form_submission');
?>

How to solve Bitbucket pipeline error : vendor/bin/phpunit: No such file or directory

For my Laravel application, I have created a bitbucket-pipeline :

image: php:8.0
  pipelines:
     branches:
          stage:
         - step:
           name: Install Dependencies
      caches:
        - composer
        - node
      script:
        - apt-get update && apt-get install -y unzip libpng-dev libjpeg-dev libfreetype6-dev
        - docker-php-ext-configure gd --with-freetype --with-jpeg
        - docker-php-ext-install gd
        - curl -sS https://getcomposer.org/installer | php
        - mv composer.phar /usr/local/bin/composer
        - composer install --no-scripts
        - curl -sL https://deb.nodesource.com/setup_16.x | bash -
        - apt-get install -y nodejs
        - npm install --legacy-peer-deps
  - step:
      name: Run Tests
      script:
        - vendor/bin/phpunit
  - step:
      name: Build Assets
      caches:
        - node
      script:
        - npm run prod
  - step:
      name: Migrate Database
      script:
        - php artisan migrate --force
        - php artisan key:generate
        - php artisan jwt:secret
      services:
        - mysql

      definitions:
        services:
           mysql:
           image: mysql:5.7

     caches:
       composer: ~/.composer/cache
       node: ~/.npm

So far so good, but when I run this, I get the error:

bash: vendor/bin/phpunit: No such file or directory

I checked that the folder exist and everything is fine, but i still get the error.

can someone help me out?

Active Directory multiple search from base dn

I have users in multiple domains.
For example:
DC=domain,DC=local; - (main domain) DC=department1,DC=domain,DC=local; - (subdomain1) DC=department2,DC=domain,DC=local; - (subdomain2)

There is a group in the main domain called group1 and some users in the subdomain are in this group.

If I want to get a list of users in group 1 via php, only users in the main domain will be visible. Users in the subdomain will not be visible.

How can I get a list of all users in group1.

This is my code in php:

header('Content-Type: application/json; charset=utf-8');

set_time_limit(30);
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set('display_errors',1);

$ldaphost = "ldap://domain.local";
//Порт
$ldapport = "389";

$ldap = ldap_connect($ldaphost,$ldapport) or die('Cannot connect to LDAP Server.');
//Включаем LDAP протокол версии 3
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3) or die('Unable to set LDAP protocol version');
//Отключаем обработку рефералов для ldap v3
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0) or die('Unable to set LDAP OPT REFERRALS');

if ($ldap) /* Получаем данные из AD */
{
    $ldapuser      = 'ldap_system';  
    $ldappass     = '123456';

    $bind = ldap_bind($ldap,$ldapuser,$ldappass);
    if ($bind) //Привязка LDAP прошла успешно!
    {
        $query = ldap_search($ldap,"DC=domain,DC=local","(&(memberOf=CN=group1,OU=PQ185,OU=testGroups,DC=domain,DC=local)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))");

        // Read all results from search
        $data = ldap_get_entries($ldap, $query);
        // Loop over 
        $userdata = array();
        for ($i=0; $i < $data['count']; $i++) {
            array_push(
                $userdata, array(
                    'i' => $i,
                    'displayname' => $data[$i]['displayname'][0],
                    'samaccountname' => $data[$i]['samaccountname'][0],
                    'description' => $data[$i]['description'][0]
                )
            );
        }
        $json = json_encode($userdata);

        echo $json;
    }
}

No Duplicate Primary Key Error Message shown

please help me.
When i add a new Row, and i put something into the Primary Key Field that already exists, in my error.log
it throws an exception but on the website it still says “Row added Successfully” (its in german)

if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["addRow"])) {
    $tableName = isset($_POST["tableName"]) ? trim($_POST["tableName"]) : '';
    $columnsResult = $conn->query("SHOW COLUMNS FROM $tableName");
    $columns = [];
    $valuesArray = [];
    while ($column = $columnsResult->fetch_assoc()) {
        $columns[] = $column['Field'];
        $valuesArray[] = isset($_POST[$column['Field']]) ? trim($_POST[$column['Field']]) : '';
    }
    $columnsString = implode(", ", $columns);
    $placeholders = implode(", ", array_fill(0, count($columns), "?"));
    $insertQuery = "INSERT INTO $tableName ($columnsString) VALUES ($placeholders)";
    $stmt = $conn->prepare($insertQuery);
    $types = str_repeat("s", count($valuesArray));
    $stmt->bind_param($types, ...$valuesArray);

    try {
        $stmt->execute();
        $successMessage = 'Neue Zeile erfolgreich hinzugefügt!';
    } catch (mysqli_sql_exception $e) {
        if ($e->getCode() == 1062) { // Duplicate entry error code
            $errorMessage = 'Fehler beim Hinzufügen der Zeile: Eintrag mit demselben Primärschlüssel existiert bereits.';
        } else {
            $errorMessage = 'Fehler beim Hinzufügen der Zeile: ' . $e->getMessage();
        }
        error_log($e->getMessage()); // Log the error message
    } finally {
        $stmt->close();
    }
}

Already shown in the Code waht i tried, catch mysqli sql exception

Fos elastic search configuration

Unrecognized option “types” under “fos_elastica.indexes.wg_subject”. Available options are “_id”, “_routing”, “_source”, “analyzer”, “client”, “date_detection”, “d
ynamic”, “dynamic_date_formats”, “dynamic_templates”, “finder”, “index_name”, “index_prototype”, “indexable_callback”, “numeric_detection”, “persistence”, “propert
ies”, “serializer”, “settings”, “use_alias”.

help me regarding this? Actually upgrading version then elastica compatibility missing and upgraded fos-elastica bundle so this problem araising please suggest me what to do?
here is my configuration below

fos_elastica:
    clients:
        default: {host: '%elasticsearch.host%', port: '%elasticsearch.port%' }
    indexes:
        wg_subject:
            settings:
                index:
                    analysis:
                        analyzer:
                            wg_subj_stem:
                                type: pattern
                                pattern: "_"
            types:
                subject:
                    properties:
                        name: ~
                        matches: { type: text, analyzer: wg_subj_stem }
                    persistence:
                        driver: orm
                        model: WGWGBundleEntitySubject
                        provider: ~
                        listener: ~


        wg_category:
            properties:
                category:
                    properties:
                        name: ~
                    persistence:
                        driver: orm
                        model: WGWGBundleEntitySubjectCategory
                        provider: ~
                        listener: ~
        
        wg_course:
            settings:
                index:
                    analysis:
                        analyzer:
                            wg_subj_stem:
                                type: pattern
                                pattern: "_"
            properties:   
                course:
                    properties:
                        name: ~
                        matches: { type: text, analyzer: wg_subj_stem }
                        schools: { type: integer }
                        titles: ~
                    persistence:
                        driver: orm
                        model: WGWGBundleEntityCourse
                        provider: ~
                        listener: ~
                        model_to_elastica_transformer:
                            service: WGWGBundleProviderCourseModelToElasticaTransformer
        
        wg_tutor:
            properties:
                tutor:
                    indexable_callback: [ '@WGWGBundleServicesUserManager', 'validTutor' ]
                    properties:
                        displayName: ~
                        gender: { type: text, analyzer: keyword }
                        schools: { type: integer }
                        availableSchools: { type: integer }
                        graduationYear: { type: integer }
                        subjects: { type: text, analyzer: keyword }
                        categories: { type: text, analyzer: keyword }
                        organizations: { type: integer }
                        studentRate: { type: integer }
                        currentResponseRate: { type: float }
                        currentResponseTime: { type: float }
                        allTimeResponseRate: { type: float }
                        allTimeResponseTime: { type: float }
                        courses:
                            type: nested
                            include_in_parent: true
                            properties:
                                group: { type: text, analyzer: keyword }
                                section: { type: text, analyzer: keyword }
                        courseGroups: { type: text, analyzer: keyword }
                        courseTitles: ~
                        schedule:
                            type: nested
                            include_in_parent: true
                            properties:
                                start: { type: date }
                                end: { type: date }
                                type: { type: text }
                    persistence:
                        driver: orm
                        model: WGWGBundleEntityUser
                        finder: ~
                        model_to_elastica_transformer:
                            service: 'WGWGBundleProviderUserTutorModelToElasticaTransformer' 

What is going wrong in my configuration?

PHPStorm – change the position of a pop-up window to open on another monitor

I’m new to programming in php and I have got a problem with the pop-up window of my website.

There is a button that opens a pop-up window, and in the process, it generates a pdf-file in the new opened window. The problem that I have is, that the pop-up window does not stay on the other screen. I’m working with a dual monitor setup and the pop-up always appears on the screen, where the main browser is opened on.

If the main browser tab is opened on the left screen, I want the pop-up to always show on the right side on the position, where I dragged it to and vice versa. I just can’t get it to work propperly and I have high hopes, that someone here could help me out with this problem.

Thanks in advance and have a great day!

I tried to add values to the window screen width and the screen top.
I asked ChatGPT about the problem but could not get a working answer, even with providing my code.

Add line of text within cart totals table on cart page in Woocommerce

I’m looking to add a line of text within my cart totals table. I am using Woocommerce plus Woocommerce subscriptions, and am selling a subscription with both a signup fee, and recurring costs. I want to separate the one-off payment and recurring payments by including a line of text in the table, basically separating them into two blocks.

The first 4 rows then become:

Overview

  • Subtotal
  • VAT
  • Total

Subscription costs

  • Subtotal / year
  • VAT / year
  • Recurring total / year

How can I add the **Subscription costs in the table? Splitting them into two tables with a separate header could also work for us. Any help would be greatly appreciated!

Here an example of how the cart currently looks (its in Dutch).enter image description here

Trouble Interacting with Dropdown FormField in PHPWord

I’m using PHPWord to create a Word document with an interactive dropdown form field. Below is a snippet of my code:

$cell = $table->addCell();
$textRun = $cell->addTextRun();
$textRun->addFormField('dropdown')->setEntries(['Choice 1', 'Choice 2', 'Choice 3'])->setValue(1);

However, when the Word document is opened, the dropdown displays the selected value (“Choice 2”) but does not allow me to change the selected option interactively.

I want to create a dropdown like this:
enter image description here

But the result not my expected. I Can’t change the option and there isn’t any dropdown arrow. I can see the other options when I double click on the field and they appear to be editable (Can add, remove and change sequence). And when I click “OK” to close the popup, the selected option always changes to the first of option (“Choice 1” in this case).
enter image description here

Has anyone else encountered this issue or have any suggestions on what may be causing this and how to fix it? Any help or pointers would be greatly appreciated!

Thanks in advance!