Appearance
Create and publish a Menzzo product
Follow a product from Logidav’s creation screen through validation, publication flags, the outbound file and the returned Magento identifier. This guide reviews axelites/logidav@88d9180215a5d489407498fe4905fdd38efd756d; the cross-system journey connects it to Meduse and Magento. Source review does not establish deployed behavior or owner acceptance.
Create or reopen a draft
Open Produits → Gestion des produits → Création de produit → Création de produit menzzo. The last menu entry opens the Menzzo new-product list. (menu, list route)
To start a draft, choose Créer produit. The modal defaults to Nouvelle référence; it also offers creating a color or format for an existing reference, or multiplying an existing reference. Submit with Créer to open the product form. The modal posts to new_product_add_update, which serves /new-product/add-update/{id} for both a new draft and an existing one. (list button and modal inclusion, creation choices and form target, submit button, form route)
For example, use the synthetic SKU SKU-DEMO-42 while entering the reference, prices, product details, store content, and images. Tout Enregistrer saves through new_product_save; Logidav validates EAN data, saves the draft, records its history, and returns the saved product ID. A new record starts with is_publish = 0. To edit later, choose Voir on its row, which opens the same form with that draft's ID. (save button, save route and persistence, new-record flag, row edit link)
Queue publication from the form
The detail-form Publier button appears when the record has an availability date and is not already marked published. The template adds a disabled attribute while to_publish is 1 or 2. Clicking it posts the draft ID to new_product_to_synchronise_in_magento. Before setting the queue flag, the controller checks that prices and delivery data are present, that each product has images with ALT text plus base and rollover roles, and that EANs do not conflict with another product. A failed check returns a warning and leaves the item out of the queue. (button conditions, click handler, publish checks and queue flag, price checks, image checks, EAN conflict check)
When checks pass, Logidav sets to_publish = 1 and stores the user and publication date if is_publish < 2. The success text says the product will be published (or modified) in Menzzo. This is a queued request, not proof the product is already available in Menzzo. (controller transition)
There is a second, similarly named Publier control on the list row. In this revision, the row button is shown for is_publish = 1; its JavaScript calls new_product_create_in_magento, whose controller starts the command menzzo:new-product:create. The command source labels itself deprecated and says creation is now handled by menzzo:new-product:synchronise --action=sync. Treat the row action as a separate legacy path; it is not the detail-form queue action described below. (row status and label, row click, route starts legacy command, deprecation note)
What the synchronization command does
The Symfony command is menzzo:new-product:synchronise; it requires an --action. With --action=sync, it takes at most ten NewProduct rows whose to_publish flag is 1. For each selected row, it builds a product payload and attempts to send that payload to Meduse. (command and actions, batch selection, per-row payload)
The command locks by command name plus action. If that lock is already held, it prints that another process is running and returns success code 0; the normal path releases the lock after its action. The repository also contains a shell loop that invokes --action=sync every two seconds. This proves the loop exists in source, not that it is installed, running, or scheduled on any environment. The loop does not invoke the finished-file action. (lock and action dispatch, source loop)
For SKU-DEMO-42, the source-backed flag sequence is:
| Point in the flow | is_publish | to_publish | What the source shows |
|---|---|---|---|
| New draft saved | 0 | unchanged here | The service initializes the new record's is_publish flag. |
| Detail-form checks pass | unchanged | 1 | The publish endpoint queues the record. |
| Sync command reaches its FTP block | unchanged | 2 | The command marks the attempt after calling the FTP sender. This value does not prove the file was transferred. |
A finished CSV row matches this product and has a numeric magento_id | 2 | 0 | The finished-file action updates the linked new-product flags. |
Files at the FTP boundary
For each queued NewProduct row, Logidav writes its JSON payload to a local temporary file named with the TMP_ prefix, calls the Meduse FTP sender, and unlinks the local temporary file after a normal return. The remote destination is a relative path of this form:
text
meduse/connectors/logidav/new-product/pending/logidav_new_products_<YYYYmmddHHMMSS>_<0..1000>.jsonThe filename comes from a second-resolution timestamp plus a random integer, and the transfer uses binary mode. The Logidav code shown here does not move or remove that outbound remote file after upload; its downstream handling is documented in the end-to-end product publication flow. (temporary file and send call, FTP filename and mode)
The send result needs care: the command ignores the FTP put return value. If FTP returns false, Logidav still removes the local file and sets to_publish = 2. If the FTP call throws, the inner catch logs the error, the following unlink() is skipped, and the code still sets to_publish = 2; the temporary file can remain. No retry or catch-path cleanup for this upload is present. A failure earlier while building a product is caught per record and logged before those flag updates. (upload error handling and flag update)
Read Meduse's finished CSV
The same command has a separate --action=checkCreatedProductsFromMeduse branch. It lists .csv files from meduse/connectors/logidav/new-product/finished/, downloads each into a local temporary file, and parses comma-separated rows using the sku and magento_id headers. If a SKU is not found in Logidav, that row is skipped. If the row has a numeric Magento ID, Logidav fills source_id and clears is_new when the product has no source ID yet; when the product is linked to a NewProduct, Logidav sets is_publish = 2 and to_publish = 0. It also records a numeric feedId when the CSV supplies one. (action branch and row updates, finished-file processing, finished directory read)
The reader also conditionally imports parcel JSON and parcel EANs/count, shipping amount, store URLs, product photos, and delivery coefficients. When it first fills a missing source_id, it requests menzzo:v2:products --productId=<Magento ID> to refresh the local product. These are additional side effects of the acknowledgement, not a single flag-only transaction. See product refresh and feedback fields.
After a non-empty file is processed, Logidav tries to delete the remote CSV. The delete helper makes four attempts total, waiting two seconds and reconnecting between failed attempts; a final failure is caught and logged by the caller. Empty files are skipped before deletion, and an exception while processing a file also leaves it for a later invocation. The source loop above only invokes --action=sync, so it does not prove that this finished-file action is being run. (delete and retry handling, caller cleanup and errors, file deletion call)
View diagram source
sequenceDiagram
actor Operator
participant UI as Logidav product form
participant Web as NewProductController
participant DB as Logidav records
participant Sync as menzzo:new-product:synchronise
participant FTP as Meduse FTP
participant Meduse as Meduse import
Operator->>UI: Create SKU-DEMO-42, edit fields, Tout Enregistrer
UI->>Web: POST new_product_save
Web->>DB: Save draft and history (is_publish = 0)
Operator->>UI: Click detail-form Publier
UI->>Web: POST new_product_to_synchronise_in_magento
Web->>DB: Validate, set to_publish = 1
Sync->>DB: Select up to 10 rows with to_publish = 1
Sync->>FTP: Upload JSON to new-product/pending/...
Sync->>DB: Set to_publish = 2 after upload attempt
FTP-->>Meduse: Pending JSON (remote handling is covered by the linked flow)
Meduse-->>FTP: Finished CSV (separate system boundary)
Sync->>FTP: checkCreatedProductsFromMeduse reads finished CSV
Sync->>DB: Match SKU and Magento ID, set is_publish = 2, to_publish = 0
Sync->>FTP: Delete finished CSV (retry up to four attempts)
Evidence limits
The source confirms the UI routes, validation gates, flags, named command, payload filename, and Logidav's finished-CSV reader. It does not confirm the active Logidav revision, whether either command action is running, whether the outbound FTP transfer succeeded, whether a finished CSV arrives, or whether a product is visible in the Menzzo storefront. Verify those boundaries in the linked cross-system guide and in the target environment before treating a draft as published.