Problème avec phpBB :

Suggestions, problèmes,...
Avatar du membre
Unix-Linux
Membre
Membre
Messages : 12510
Enregistré le : 10 nov. 2017, 21:50
Score de réactions : 167
Dernière activité : Hier, 21:45

Problème avec phpBB :

Message par Unix-Linux »

A chaque fois que je réponds à un message, lors de l'envoi, erreur :
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/notification/type/post.php on line 382: Undefined array key "forum_name"
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 1821: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3076)
En réactualisant, il mets deux fois ma réponse....

Après, y'a toute la clientèle qui se dit que je mets deux fois ma réponse histoire d'être bien lu ... :boulet: :mrgreen:

Après recherche, ça donne :
Ce problème est classique sur les forums phpBB. Il se compose en réalité
de **deux erreurs liées** : une erreur de code principale et une erreur de
conséquence.

Voici l'analyse et les solutions pour régler cela.

### 1. Analyse des erreurs

* **Erreur 1 (La cause) :** `Undefined array key "forum_name"`
* **Où :** `phpbb/notification/type/post.php` ligne 382.
* **Pourquoi :** Le script essaie de lire le nom d'un forum
(`forum_name`) pour envoyer une notification, mais cette information
n'existe pas dans les données récupérées (souvent parce que le forum a été
supprimé, ou lors de la validation de messages, ou à cause d'un bug dans
une version spécifique de phpBB).
* **Erreur 2 (La conséquence) :** `Cannot modify header information -
headers already sent`
* **Où :** `includes/functions.php`.
* **Pourquoi :** Comme la première erreur a généré un message
d'avertissement (affichage texte), PHP considère que l'envoi de la page a
commencé. Quand phpBB essaie ensuite de faire une redirection ou de gérer
la session (envoi d'en-têtes HTTP), il échoue car "la sortie a déjà
commencé".

**En résumé :** C'est un bug connu dans certaines versions de phpBB
(notamment la série 3.3.x avant la 3.3.5/3.3.6), aggravé par le fait que
le **mode Debug est activé**.

---

### 2. Solutions

Voici les étapes pour résoudre le problème, de la plus simple à la plus
durable.

#### Solution A : Désactiver le mode Debug (Correctif immédiat)
C'est la chose la plus importante à faire sur un forum en production. Le
mode Debug ne doit jamais être activé sur un site public, car il affiche
les erreurs et casse les redirections (Erreur 2).

1. **Via le fichier `config.php` :**
* Ouvrez le fichier `config.php` à la racine de votre forum via FTP.
* Cherchez la ligne : `define('DEBUG', true);`
* Remplacez-la par : `define('DEBUG', false);`
* *(Note : Sur les versions récentes, cela se gère souvent via le
Panel d'Administration, mais le fichier reste la méthode sûre).*

2. **Via le Panel d'Administration (ACP) :**
* Allez dans **Panneau d'administration** > **Général** >
**Configuration du serveur**.
* Mettez **Débogage** sur **Non**.

*Cela fera disparaître l'erreur "headers already sent" immédiatement, car
les avertissements ne seront plus affichés à l'écran.*

#### Solution B : Mettre à jour phpBB (Correctif durable)
Ce bug a été corrigé dans les versions récentes de phpBB.
* Si vous utilisez une version **3.3.0 à 3.3.4**, il est fortement
recommandé de passer à la dernière version stable (actuellement **3.3.10**
ou supérieure).
* La mise à jour corrigera le fichier `post.php` pour qu'il vérifie
l'existence de `forum_name` avant de l'utiliser.

#### Solution C : Correction manuelle du code (Si vous ne pouvez pas
mettre à jour)
Si vous êtes bloqué sur votre version actuelle, vous pouvez patcher le
fichier vous-même.

1. Ouvrez le fichier : `/phpbb/notification/type/post.php`.
2. Allez autour de la **ligne 382** (le numéro peut varier légèrement
selon la version).
3. Vous cherchez un code qui ressemble à ceci :
```php
'forum_name' => $row['forum_name'],
```
ou
```php
$this->user->lang('NOTIFICATION_POST', $row['forum_name'], ...
```
4. Vous devez vous assurer que la clé existe. Modifiez le code pour
utiliser l'opérateur de fusion null (`??`) ou une vérification `isset`.
* *Exemple de correction :*
Remplacez `$row['forum_name']` par `($row['forum_name'] ?? '')` ou
vérifiez si la variable est vide.

*Correction spécifique souvent appliquée pour ce bug :*
Cherchez la ligne où `$notification_data` est construit. Assurez-vous
que `forum_name` est défini même si vide.
```php
// Avant (buggé)
'forum_name' => $row['forum_name'],

// Après (corrigé)
'forum_name' => $row['forum_name'] ?? '',
```

#### Solution D : Nettoyage de la base de données (Si le problème
persiste)
Parfois, des notifications "orphelines" restent en base de
données pour des forums supprimés.
1. Allez dans votre **Panneau d'Administration**.
2. Allez dans **Général** > **Nettoyage de la base de données** (si
disponible via extension) ou utilisez phpMyAdmin.
3. Si vous utilisez phpMyAdmin, vous pouvez vider la table
`phpbb_notifications` (attention, cela effacera toutes les notifications
des utilisateurs) ou chercher les entrées avec un `forum_id` qui n'existe
plus.

### Recommandation finale
1. **Désactivez le DEBUG** tout de suite (Solution A).
2. **Sauvegardez** votre site (fichiers + base de données).
3. **Mettez à jour phpBB** vers la dernière version (Solution B).
Cela règlera définitivement le problème. ;-) Si ça bug, c'est pas de ma faute, c'est celle du PC ;-)
Parabole Triax Multifeed 4 LNB + DAB+ RTL2832U R820T2 + CI Module
Base (Voo HFC - EDPnet VDSL XL - Brutele - RealRoot - Tvcablenet)
Raspberry Pi 4 : FreeBSD-arm64-aarch64
Raspberry Pi 4 : Gentoo arm64
Orange Pi 5 Ultra : DietPi + NAS
Server : Ubuntu LTS
Avatar du membre
solar10
Modérateur en chef
Modérateur en chef
Messages : 21638
Enregistré le : 01 nov. 2017, 12:15
Score de réactions : 751
Dernière activité : Hier, 23:21
Localisation : https://www.liege.be/fr/evenements/agenda
Âge : 63

Problème avec phpBB :

Message par solar10 »

Tu as un script ou un css custom?
Internet: Edpnet VDSL XL + Fritz!Box 7530AX+4040
TV: TCL 50P616 UHD/HDR Android TV + Fransat CAM+Carte + TNT belge + Wavefrontier T90 (5°W + 13°E +19.2E + 28.2°E)
Tel Fixe: VOIP OVH (abo découverte) + Clone Betamax + 4x Fritz!Fon C5
Tel Mobile: abo DIGI5 (eSIM) - Google Pixel 7a
NAS: Orange Pi 3 LTS avec boitier Fantec 4 baies, 26TB
Avatar du membre
Unix-Linux
Membre
Membre
Messages : 12510
Enregistré le : 10 nov. 2017, 21:50
Score de réactions : 167
Dernière activité : Hier, 21:45

Problème avec phpBB :

Message par Unix-Linux »

solar10 a écrit : 05 avr. 2026, 18:47 Tu as un script ou un css custom?
Non.

Dans :
/phpbb/notification/type/post.php`.
Allez à la **ligne 382** (ou cherchez la référence à `forum_name`).

Le code ressemble probablement à ceci :
```php
'forum_name' => $row['forum_name'],
```
Il faut le modifier pour vérifier si la clé existe (compatible PHP 8+) :
```php
'forum_name' => $row['forum_name'] ?? '',
```
*Ou bien entourer la condition avec un `isset()`.*

Mettre à jour phpBB
Ce bug est connu sur certaines versions de phpBB 3.3.x avec PHP 8. La mise
à jour vers la dernière version stable (ex: 3.3.11 ou plus) corrige
souvent ce problème nativement.
Parabole Triax Multifeed 4 LNB + DAB+ RTL2832U R820T2 + CI Module
Base (Voo HFC - EDPnet VDSL XL - Brutele - RealRoot - Tvcablenet)
Raspberry Pi 4 : FreeBSD-arm64-aarch64
Raspberry Pi 4 : Gentoo arm64
Orange Pi 5 Ultra : DietPi + NAS
Server : Ubuntu LTS
Avatar du membre
Cris
Fondateur
Fondateur
Messages : 11964
Enregistré le : 31 oct. 2017, 14:17
Score de réactions : 467
Dernière activité : Hier, 22:43
Localisation : Liège (Province)
Âge : 51

Problème avec phpBB :

Message par Cris »

J'ai eu cette erreur au début de la migration sur le nouvel hébergeur (résolu en synchronisant les messages).
Qui d'autre à ce souci ?

Le forum est déjà sur la dernière version phpBB, une nouvelle mise à jour est en préparation (en bêta pour le moment).
Je l'installerai le moment voulu en espérant que ça puisse résoudre les problèmes que certain ont.
X (Twitter) du forum: https://x.com/forumbelcom

📲 iPhone 16 Plus 📶 Connected Mobile Intense Orange (Pro) et Tempo Orange (Perso) ⌚ Apple Watch 10
💻 MacBook Air M1 🌐 Internet Hey! 200/12 📺 Netflix, Disney+, Molotov et d'autres apps gratuites
Avatar du membre
tortipouss
Membre
Membre
Messages : 739
Enregistré le : 10 nov. 2022, 18:00
Score de réactions : 20
Dernière activité : Hier, 12:24
Localisation : Département du Hainaut (France?)
Âge : 36

Problème avec phpBB :

Message par tortipouss »

Plouf
Cris a écrit : 06 avr. 2026, 13:16 Le forum est déjà sur la dernière version phpBB, une nouvelle mise à jour est en préparation (en bêta pour le moment).
C'est en Release Canditat depuis le 1er Avril à 15h46. :mrgreen: :geek:
https://download.phpbb.com/pub/release/3.3/unstable/3.3.16-RC1/
Image
Anti-IA à 100%!!!
Avatar du membre
Cris
Fondateur
Fondateur
Messages : 11964
Enregistré le : 31 oct. 2017, 14:17
Score de réactions : 467
Dernière activité : Hier, 22:43
Localisation : Liège (Province)
Âge : 51

Problème avec phpBB :

Message par Cris »

Ok, elle ne va plus tarder à arriver officiellement alors :smile:

:merci: pour l'info.
X (Twitter) du forum: https://x.com/forumbelcom

📲 iPhone 16 Plus 📶 Connected Mobile Intense Orange (Pro) et Tempo Orange (Perso) ⌚ Apple Watch 10
💻 MacBook Air M1 🌐 Internet Hey! 200/12 📺 Netflix, Disney+, Molotov et d'autres apps gratuites
Avatar du membre
solar10
Modérateur en chef
Modérateur en chef
Messages : 21638
Enregistré le : 01 nov. 2017, 12:15
Score de réactions : 751
Dernière activité : Hier, 23:21
Localisation : https://www.liege.be/fr/evenements/agenda
Âge : 63

Problème avec phpBB :

Message par solar10 »

Aucun problème de ce type (aucun tout court même) tant sur Android que sur PC Linux.
Internet: Edpnet VDSL XL + Fritz!Box 7530AX+4040
TV: TCL 50P616 UHD/HDR Android TV + Fransat CAM+Carte + TNT belge + Wavefrontier T90 (5°W + 13°E +19.2E + 28.2°E)
Tel Fixe: VOIP OVH (abo découverte) + Clone Betamax + 4x Fritz!Fon C5
Tel Mobile: abo DIGI5 (eSIM) - Google Pixel 7a
NAS: Orange Pi 3 LTS avec boitier Fantec 4 baies, 26TB
Avatar du membre
Mackguil
Modérateur en chef
Modérateur en chef
Messages : 22116
Enregistré le : 31 oct. 2017, 18:35
Score de réactions : 394
Dernière activité : Hier, 20:36
Localisation : Tx

Problème avec phpBB :

Message par Mackguil »

solar10 a écrit : 06 avr. 2026, 13:49 Aucun problème de ce type (aucun tout court même) tant sur Android que sur PC Linux.
Moi non plus, rien à signaler sur PC en Linux.
Internet: Fiber150 Fastfiber 34.95, Tél fixe OVH + Betamax 2.5 euros, Mobile orange 1.5 euros, MolotovTV bouquet Extended à l'année 8.33€ par mois, Zattoo TV.


+-47 euros/mois pour du quadruple play fibré, les alternatives existent, si l'on ajoute l'abonnement mobile Français avec 300 Gigas, minutes et sms illimités, on arrive à 57 euros.il faut juste oser !
Avatar du membre
Cris
Fondateur
Fondateur
Messages : 11964
Enregistré le : 31 oct. 2017, 14:17
Score de réactions : 467
Dernière activité : Hier, 22:43
Localisation : Liège (Province)
Âge : 51

Problème avec phpBB :

Message par Cris »

:merci:

Ca me rassure...
X (Twitter) du forum: https://x.com/forumbelcom

📲 iPhone 16 Plus 📶 Connected Mobile Intense Orange (Pro) et Tempo Orange (Perso) ⌚ Apple Watch 10
💻 MacBook Air M1 🌐 Internet Hey! 200/12 📺 Netflix, Disney+, Molotov et d'autres apps gratuites
Avatar du membre
solar10
Modérateur en chef
Modérateur en chef
Messages : 21638
Enregistré le : 01 nov. 2017, 12:15
Score de réactions : 751
Dernière activité : Hier, 23:21
Localisation : https://www.liege.be/fr/evenements/agenda
Âge : 63

Problème avec phpBB :

Message par solar10 »

Update.
J'ai eu l'erreur 1x cet aprem, sur Vivaldi mobile
Internet: Edpnet VDSL XL + Fritz!Box 7530AX+4040
TV: TCL 50P616 UHD/HDR Android TV + Fransat CAM+Carte + TNT belge + Wavefrontier T90 (5°W + 13°E +19.2E + 28.2°E)
Tel Fixe: VOIP OVH (abo découverte) + Clone Betamax + 4x Fritz!Fon C5
Tel Mobile: abo DIGI5 (eSIM) - Google Pixel 7a
NAS: Orange Pi 3 LTS avec boitier Fantec 4 baies, 26TB
Avatar du membre
Mackguil
Modérateur en chef
Modérateur en chef
Messages : 22116
Enregistré le : 31 oct. 2017, 18:35
Score de réactions : 394
Dernière activité : Hier, 20:36
Localisation : Tx

Problème avec phpBB :

Message par Mackguil »

Erreur rencontrée hier par deux fois.
Internet: Fiber150 Fastfiber 34.95, Tél fixe OVH + Betamax 2.5 euros, Mobile orange 1.5 euros, MolotovTV bouquet Extended à l'année 8.33€ par mois, Zattoo TV.


+-47 euros/mois pour du quadruple play fibré, les alternatives existent, si l'on ajoute l'abonnement mobile Français avec 300 Gigas, minutes et sms illimités, on arrive à 57 euros.il faut juste oser !
Avatar du membre
Unix-Linux
Membre
Membre
Messages : 12510
Enregistré le : 10 nov. 2017, 21:50
Score de réactions : 167
Dernière activité : Hier, 21:45

Problème avec phpBB :

Message par Unix-Linux »

Mackguil a écrit : 18 avr. 2026, 11:43 Erreur rencontrée hier par deux fois.
Idem hier, d'où la réaction de tntuner :wink: ==> viewtopic.php?p=204543#p204543
Parabole Triax Multifeed 4 LNB + DAB+ RTL2832U R820T2 + CI Module
Base (Voo HFC - EDPnet VDSL XL - Brutele - RealRoot - Tvcablenet)
Raspberry Pi 4 : FreeBSD-arm64-aarch64
Raspberry Pi 4 : Gentoo arm64
Orange Pi 5 Ultra : DietPi + NAS
Server : Ubuntu LTS
Avatar du membre
dreamman
Membre
Membre
Messages : 1148
Enregistré le : 11 nov. 2017, 22:17
Score de réactions : 36
Dernière activité : Hier, 21:24

Problème avec phpBB :

Message par dreamman »

Videz le cache...
Internet Orange (sur le réseau de Telenet) Internet Start 200/15.

TV LG OLED 48" 48C1(16LA), Chromast Ultra 4k, Formuler Z8
Réception TV: TV+ (2€/mois), Molotov (10€/année), DVB-T2 (Belgique), Auvio,

Nas TS-251+ (Intel), Plex, Logitech Harmony 650
En Thaïlande, fibre 3BB 300/300 13,50 €, téléphonie AIS 8,20 € illimité data 6Mbps.
Tv idem Belgique (sauf DVB-T) avec vpn.

Image
Avatar du membre
Unix-Linux
Membre
Membre
Messages : 12510
Enregistré le : 10 nov. 2017, 21:50
Score de réactions : 167
Dernière activité : Hier, 21:45

Problème avec phpBB :

Message par Unix-Linux »

dreamman a écrit : 18 avr. 2026, 13:31 Videz le cache...
Des rouspétances ? :mrgreen:
Parabole Triax Multifeed 4 LNB + DAB+ RTL2832U R820T2 + CI Module
Base (Voo HFC - EDPnet VDSL XL - Brutele - RealRoot - Tvcablenet)
Raspberry Pi 4 : FreeBSD-arm64-aarch64
Raspberry Pi 4 : Gentoo arm64
Orange Pi 5 Ultra : DietPi + NAS
Server : Ubuntu LTS
Avatar du membre
Unix-Linux
Membre
Membre
Messages : 12510
Enregistré le : 10 nov. 2017, 21:50
Score de réactions : 167
Dernière activité : Hier, 21:45

Problème avec phpBB :

Message par Unix-Linux »

Toujours la même chose :
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/notification/type/post.php on line 382: Undefined array key "forum_name"
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 1821: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3076)
How to fix it ?
Thinking...
...done thinking.
## TL;DR  
The “Undefined array key **forum_name**” warning is the root cause.  
It is thrown while the **post notification** class builds the data that 
will be sent to users. Because the key isn’t set, PHP emits a warning, 
which in turn starts output **before** PHP can send HTTP headers → the 
“Cannot modify header information” warning.  

Fix the missing **forum_name** entry (or the code that should set it) and 
the header‑sent error disappears automatically.

---

## 1️⃣ What the stack‑trace is telling you

| File / Line | Message | Why it matters |
|-------------|---------|----------------|
| `phpbb/notification/type/post.php:382` | **Undefined array key 
“forum_name”** | The notification class expects `$data['forum_name']` (or 
`$event['forum_name']`) to exist when it builds the email/alert. |
| `includes/functions.php:1821` | **Cannot modify header information** | 
PHP has already sent some output (the warning above). When phpBB later 
tries to send a redirect or a cookie header it fails. This is a *symptom*, 
not the *root* cause. |

All other “output started at … functions.php:3076” comes from the same 
warning that was printed earlier.

---

## 2️⃣ Why `forum_name` can be missing

| Situation | How it happens |
|-----------|-----------------|
| **Out‑of‑date core files** (e.g. you upgraded from 3.2 → 3.3 but only 
some files were replaced) | Newer notification code now expects a 
`forum_name` entry that older PHP files never supplied. |
| **Broken/disabled language pack** | The language file that defines 
`$user->lang['FORUM']` or the template variable used to fill 
`$data['forum_name']` is missing, causing the variable to be empty/unset. 
|
| **Custom extension overriding the post notification** | An extension 
may hook into `notification_manager` and alter the `$event` array, 
accidentally dropping `forum_name`. |
| **Database inconsistency** (e.g. forum rows missing the `forum_name` 
column) | Very rare, but if the `phpbb_forums` table was manually edited 
and the column was renamed/dropped, the query that fetches the name fails. 
|
| **PHP version incompatibility** (PHP 8.1+ strictness) | Prior to PHP 8.0 
accessing a non‑existent key silently returned `null`. PHP 8.1 throws a 
*warning* that now shows up in the debug log. |

---

## 3️⃣ Quick “sanity‑check” checklist

1. **Clear the cache** – `ADM` → **General → Purge the cache** (or delete 
everything in `cache/` except `/.htaccess` and `config.php`).  
   *Why?* Some stale PHP files can linger after an upgrade.

2. **Confirm core version** – go to *Admin Control Panel → General → 
Server configuration → Version check* (or look at 
`includes/constants.php`).  
   *If you are on a version older than the latest 3.3.x stable, run the 
**official upgrade** script.*

3. **Verify language pack** – in the ACP, *System → Language packs* → make 
sure the pack you use (e.g. “English (United Kingdom)”) is **installed** 
and **enabled**. Re‑install it if needed.

4. **Disable custom extensions** temporarily.  
   Rename the extension folder (`ext/yourvendor/yourext/`) to something 
like `ext/yourvendor/yourext.disabled`.  
   If the warning disappears → the extension is the culprit.

5. **Check the database** – run the following query (via phpMyAdmin, 
Adminer, or MySQL client) to assure the column exists:

   ```sql
   SHOW COLUMNS FROM phpbb_forums LIKE 'forum_name';
   ```

   It should return a row (`forum_name` varchar(255) NOT NULL). If it’s 
missing, you have a corrupted install; re‑import the core schema from the 
current phpBB release.

---

## 4️⃣ Fixing the root cause

Below are three practical ways to get rid of the missing `forum_name` 
entry, ordered from **least invasive** to **most invasive**.

### 4.1 Core‑only fix (recommended)

Open `phpbb/notification/type/post.php` around line 380‑390 (your line 
numbers may differ slightly). You’ll see something like:

```php
$forum_name = $this->get_data('forum_name'); // <-- line 382 (example)
```

Replace the block with a defensive fallback:

```php
$forum_name = $this->get_data('forum_name');

// If the data is missing (old PHP < 8.0 behavior) we fetch it manually.
if (empty($forum_name))
{
    // $this->get_data('forum_id') is set by the notification builder.
    $forum_id = $this->get_data('forum_id');
    $sql = 'SELECT forum_name FROM ' . FORUMS_TABLE . " WHERE forum_id = 
$forum_id";
    $result = $this->db->sql_query($sql);
    $row = $this->db->sql_fetchrow($result);
    $this->db->sql_freeresult($result);

    $forum_name = $row['forum_name'] ?? '[unknown]';
}
```

**Why this works:** The code now **guarantees** that `$forum_name` is 
always defined, regardless of whether the upstream notification builder 
supplied it. The fallback fetches it directly from the DB, which is safe 
and cheap (single row).

> **Caution** – If you later upgrade phpBB, this manual edit may be 
overwritten. Record the change in a separate “patch” file, or create a 
tiny *extension* that overrides the notification class (see 
“Extension‑level fix” below).

---

### 4.2 Extension‑level fix (cleaner, upgrade‑safe)

Create a tiny local extension that *extends* the core `post` notification 
class and adds the missing key.

1. **File structure** (relative to phpBB root):

```
/ext/custom/notifications/
    composer.json
    ext.php
    /notification/
        type/
            post.php
```

2. **composer.json**

```json
{
    "name": "custom/notifications",
    "type": "phpbb-extension",
    "extra": {
        "display-name": "Custom Notification Fix",
        "soft-require": {
            "phpbb/phpbb": ">=3.3.0"
        }
    }
}
```

3. **ext.php**

```php
<?php
namespace custom\notifications;

class ext extends \phpbb\extension\base {}
```

4. **notification/type/post.php** (extend the core class)

```php
<?php
namespace custom\notifications\notification\type;

use phpbb\notification\type\post as core_post;

class post extends core_post
{
    /**
     * {@inheritDoc}
     */
    protected function get_data_for_template()
    {
        $data = parent::get_data_for_template();

        // Ensure forum_name exists; if not, pull it from DB.
        if (empty($data['forum_name']))
        {
            $sql = 'SELECT forum_name FROM ' . FORUMS_TABLE . '
                    WHERE forum_id = ' . (int) $data['forum_id'];
            $result = $this->db->sql_query($sql);
            $row = $this->db->sql_fetchrow($result);
            $this->db->sql_freeresult($result);

            $data['forum_name'] = $row['forum_name'] ?? '';
        }

        return $data;
    }
}
```

5. **Enable the extension** in the ACP → *Customise → Manage extensions*.

**Result:** The core class stays untouched; the extension will be loaded 
**after** the core class (thanks to the class name collision) and will 
fill the missing key only when needed. When you upgrade phpBB, the 
extension stays intact.

---

### 4.3 Full core reinstall (last resort)

If you suspect many core files are corrupted (e.g., after a failed FTP 
upload), simply:

1. **Download the exact same version** of phpBB you’re running from the 
official site.  
2. **Overwrite** every file **except** `config.php`, `cache/`, `files/`, 
`store/`, and any custom extensions.  
3. Run the **upgrade script** (`/install/upgrade.php`) just to be safe – 
it will only apply schema changes if needed.  

After a clean core, the warning should vanish, confirming that the problem 
was indeed a stray/old file.

---

## 5️⃣ Why the “headers already sent” warning disappears

PHP can only send HTTP headers **before** any output reaches the client 
(including warning messages).  

```
[phpBB Debug] PHP Warning:  Undefined array key "forum_name" in 
...post.php on line 382
```

That warning is printed to the browser, making PHP think output has 
already started. When phpBB later tries to `header('Location: ...')` or 
`setcookie()`, it throws the second warning.

**Fix the first warning** → no output → headers are sent normally → second 
warning disappears. No need to touch `functions.php:3076` directly.

---

## 6️⃣ Additional sanity‑checks after you fix it

1. **Test posting a new topic** *(as a normal user and as an admin)* to 
see that notifications are created without errors.  
2. **Check email notifications** (if you have SMTP enabled) – they should 
contain the forum name correctly.  
3. **Look at the log** – ACP → *Logs → Error log* – the warning should be 
gone.  
4. **Monitor the site for a few minutes** – if another “undefined array 
key” appears (e.g., `topic_title`), repeat the same pattern: add a 
fallback or fix the source that should supply it.

---

## 7️⃣ TL;DR Cheat‑sheet (copy‑paste for your notes)

```bash
# 1. Purge cache
rm -rf cache/*.php

# 2. Verify core version
grep "`$board_config['version']`" includes/constants.php

# 3. Ensure language pack is installed
#    (ACP → System → Language packs → install default if missing)

# 4. Temporarily disable extensions
mv ext/yourvendor/yourext ext/yourvendor/yourext.disabled

# 5. Quick core fix (edit post.php around line 380)
#    (fallback block that fetches forum_name from DB)

# 6. If you want a clean upgrade‑safe fix, create the tiny extension
#    (see file list and code above)

# 7. Re‑test posting – warnings gone → headers work again
```

---

## 8️⃣ When you still see the warning

| Symptom | Next step |
|---------|-----------|
| Same warning after the fallback was added | Double‑check that the file 
you edited is the **real** one (no duplicate in a custom theme folder). 
Use `grep -R "notification/type/post.php" .` to locate every copy. |
| New warning about a *different* undefined key (e.g., `topic_title`) | 
Same pattern: add a defensive fallback in the appropriate notification 
class or extension. |
| No warning, but emails are still missing the forum name | The email 
template may be using `{FORUM_NAME}` instead of `{forum_name}`. Edit 
`styles/prosilver/template/email/post_notify.html` (or your style’s 
equivalent) to use the correct variable. |
| The problem reappears after a phpBB upgrade | Re‑apply the **extension** 
solution – it survives upgrades. If you edited core files, you’ll have to 
redo the patch each time. |

---

### Bottom line

- The *real* bug is the missing `forum_name` in the post‑notification 
data.  
- Fix it (core patch **or** tiny extension) → the “headers already sent” 
warning disappears.  
- Keep a copy of the fix in an extension so future phpBB upgrades don’t 
overwrite it.  

If you run into any snags while editing the files or creating the 
extension, drop the exact line(s) you’re changing here and I can review 
them for you. Happy debugging! 🚀
Parabole Triax Multifeed 4 LNB + DAB+ RTL2832U R820T2 + CI Module
Base (Voo HFC - EDPnet VDSL XL - Brutele - RealRoot - Tvcablenet)
Raspberry Pi 4 : FreeBSD-arm64-aarch64
Raspberry Pi 4 : Gentoo arm64
Orange Pi 5 Ultra : DietPi + NAS
Server : Ubuntu LTS
Avatar du membre
Cris
Fondateur
Fondateur
Messages : 11964
Enregistré le : 31 oct. 2017, 14:17
Score de réactions : 467
Dernière activité : Hier, 22:43
Localisation : Liège (Province)
Âge : 51

Problème avec phpBB :

Message par Cris »

Tu as interrogé quelle IA pour avoir ce genre de solution ? :grin:
X (Twitter) du forum: https://x.com/forumbelcom

📲 iPhone 16 Plus 📶 Connected Mobile Intense Orange (Pro) et Tempo Orange (Perso) ⌚ Apple Watch 10
💻 MacBook Air M1 🌐 Internet Hey! 200/12 📺 Netflix, Disney+, Molotov et d'autres apps gratuites
Avatar du membre
Unix-Linux
Membre
Membre
Messages : 12510
Enregistré le : 10 nov. 2017, 21:50
Score de réactions : 167
Dernière activité : Hier, 21:45

Problème avec phpBB :

Message par Unix-Linux »

Cris a écrit : 06 juin 2026, 18:03 Tu as interrogé quelle IA pour avoir ce genre de solution ? :grin:
J'en utilise plusieurs différents, mais certains sont "spécialisés dans la programmation" genre Tensorflow et Pytorch :wink:
Parabole Triax Multifeed 4 LNB + DAB+ RTL2832U R820T2 + CI Module
Base (Voo HFC - EDPnet VDSL XL - Brutele - RealRoot - Tvcablenet)
Raspberry Pi 4 : FreeBSD-arm64-aarch64
Raspberry Pi 4 : Gentoo arm64
Orange Pi 5 Ultra : DietPi + NAS
Server : Ubuntu LTS
Avatar du membre
Cris
Fondateur
Fondateur
Messages : 11964
Enregistré le : 31 oct. 2017, 14:17
Score de réactions : 467
Dernière activité : Hier, 22:43
Localisation : Liège (Province)
Âge : 51

Problème avec phpBB :

Message par Cris »

J'ai modifié le fichier post.php
A voir ce que ca va donner...
X (Twitter) du forum: https://x.com/forumbelcom

📲 iPhone 16 Plus 📶 Connected Mobile Intense Orange (Pro) et Tempo Orange (Perso) ⌚ Apple Watch 10
💻 MacBook Air M1 🌐 Internet Hey! 200/12 📺 Netflix, Disney+, Molotov et d'autres apps gratuites
Avatar du membre
tortipouss
Membre
Membre
Messages : 739
Enregistré le : 10 nov. 2022, 18:00
Score de réactions : 20
Dernière activité : Hier, 12:24
Localisation : Département du Hainaut (France?)
Âge : 36

Problème avec phpBB :

Message par tortipouss »

Plouf
Pourquoi le forum tourne avec le vieux PHP 8.1 sans support depuis le 31 décembre 2025??? :sad: :shock: :???:

https://www.php.net/eol.php
Image
Anti-IA à 100%!!!
Avatar du membre
tntuner
Membre
Membre
Messages : 14350
Enregistré le : 01 nov. 2017, 23:12
Score de réactions : 446
Dernière activité : Hier, 12:20
Localisation : Bruxelles, Belgique, Europe, Troisième planète après le soleil
Âge : 55

Problème avec phpBB :

Message par tntuner »

Le 31/12/2025? Mais c'est la préhistoire !!!
TV: Samsung TV QLED 55" de 2023 + box Android TV, avec Amazon Prime Video, Netflix et Disney+
Internet: hey! (200 Mbps down, 10 Mbps up)
GSM: 2 abos hey! Mobile S et 1 abo hey! Mobile M
Téléphone fixe: VOIP OVH abonnement découverte
PC avec Windows 11 + antiX 21

Retourner vers « Le forum »