Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.45k stars 2.79k forks source link

v20: Unknown column ‘c.position’ in ‘field list’ #31118

Closed HLFH closed 1 month ago

HLFH commented 1 month ago

Bug

Modules/Applications: user, syslog, barcode, contrat, takepos, product, categorie, blockedlog, partnership, stancer, multicurrency, cron, agenda, banque, commande, ecm, facture, fournisseur, salaries, service, societe, ticket, knowledgemanagement, prelevement, tax, projet, fckeditor, comptabilite, export, import, propal
Type gestionnaire de base de données: mysqli
Requête dernier accès en base en erreur: SELECT DISTINCT c.rowid, c.label, c.ref_ext, c.description, c.color, c.position, c.fk_parent, c.visible FROM llx_categorie as c WHERE c.entity IN (1) AND c.type = 2
Code retour dernier accès en base en erreur: DB_ERROR_NOSUCHFIELD
Information sur le dernier accès en base en erreur: Unknown column 'c.position' in 'field list'

Dolibarr Version

develop

Environment PHP

PHP 8.2.23

Environment Database

mariadb from 11.5.2-MariaDB, client 15.2 for Linux (x86_64) using readline 5.1

Steps to reproduce the behavior and expected behavior

Update from Dolibarr 19 develop branch to Dolibarr 20 develop branch

Attached files

No response

ksar-ksar commented 1 month ago

Hello,

You must have received a warning or error message during the migration because the SQL command it there : https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/install/mysql/migration/19.0.0-20.0.0.sql#L234

Introduced 8 months ago : https://github.com/Dolibarr/dolibarr/commit/1e013212949b45957dd19c136a51a1f7e4a57552

HLFH commented 1 month ago

Ok I have updated the package dolibarr-git that I maintain on Arch Linux in order for this migration to run correctly. https://aur.archlinux.org/packages/dolibarr-git

When I am creating an invoice, I am now getting the error "Unknown column 'batch' in 'field list'":

2024/09/25 15:23:58 [error] 3628292#3628292: *734260 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined variable $filterabsolutediscount in /usr/share/dolibarr/htdocs/core/tpl/object_discounts.tpl.php on line 91; PHP message: PHP Warning:  Undefined variable $resteapayer in /usr/share/dolibarr/htdocs/core/tpl/object_discounts.tpl.php on line 91" while reading upstream, client: ipv6_address, server: erp.example.com, request: "POST /compta/facture/card.php HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm-legacy/php-fpm.sock:", host: "erp.example.com", referrer: "https://erp.example.com/compta/facture/card.php?action=create&origin=propal&originid=23&socid=2&backtopage=%2Fcomm%2Fpropal%2Fcard.php%3Fid%3D23"
sonikf commented 1 month ago

Ηι @HLFH PHP 8.3 is not officially supported yet.

HLFH commented 1 month ago

Hi @sonikf. I use php-legacy here. Sorry for writing I was using PHP 8.3, I am using in fact PHP 8.2 for dolibarr.

php-legacy --version
PHP 8.2.23 (cli) (built: Aug 28 2024 16:03:54) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.23, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.23, Copyright (c), by Zend Technologies

Same error here: https://www.dolibarr.fr/forum/t/probleme-acces-facture-apres-mlise-a-jour-19-0-2/47225/3

ksar-ksar commented 1 month ago

Can you share the full error message ?

hregis commented 1 month ago

@HLFH try to restart install for upgrade v18 to v19 database and v19 to v20

hregis commented 1 month ago

@HLFH just go to https://yourdolibarr/install ! ;-) (after rename install.lock file in document directory)

hregis commented 1 month ago

@HLFH I don't know "archlinux" but personally and from what I understand they make a package available over time without really worrying if it's functional! Why not use the official packages? See using the official git repository if you need to update in real time!? You should avoid going through unofficial structures that will provide you with unverified sources!

HLFH commented 1 month ago

@hregis I am the maintainer for dolibarr and dolibarr-git on Arch Linux. They use the official packages or sources. AUR users are free to comment on the AUR if these packages do not work.

I have a few errors partially fixed, I will try to rerun the database migrations v18 to v19 and v19 to v20 on /install.

HLFH commented 1 month ago

I think running the migrations from /install fully fixed it.