In this code (`include/functions.inc.php` function `pwg_log`:

```
  // If plugin developers add their own sections, Piwigo will automatically add it in the history.section enum column
  if (isset($page['section']))
  {
    // set cache if not available
    if (!isset($conf['history_sections_cache']))
    {
      conf_update_param('history_sections_cache', get_enums(HISTORY_TABLE, 'section'), true);
    }

    $conf['history_sections_cache'] = safe_unserialize($conf['history_sections_cache']);

    if (in_array($page['section'], $conf['history_sections_cache']))
    {
      $section = $page['section'];
    }
    elseif (preg_match('/^[a-zA-Z0-9_-]+$/', $page['section']))
    {
      $history_sections = get_enums(HISTORY_TABLE, 'section');
      $history_sections[] = $page['section'];

      // alter history table structure, to include a new section
      pwg_query('ALTER TABLE '.HISTORY_TABLE.' CHANGE section section enum(\''.implode("','", array_unique($history_sections)).'\') DEFAULT NULL;');

      // and refresh cache
      conf_update_param('history_sections_cache', get_enums(HISTORY_TABLE, 'section'), true);

      $section = $page['section'];
    }
  }
```

We do as if the `history.section` is case sensitive. It's not. If you try to add `section42` in the ENUM field while `Section42` already exists, MySQL will throw an error.
history.section autofill should not be case sensitive
This is a GitHub Issue
repo:Piwigo
owner:Piwigo
Title : history.section autofill should not be case sensitive
Issue date:

--- start body ---
In this code (`include/functions.inc.php` function `pwg_log`:

```
  // If plugin developers add their own sections, Piwigo will automatically add it in the history.section enum column
  if (isset($page['section']))
  {
    // set cache if not available
    if (!isset($conf['history_sections_cache']))
    {
      conf_update_param('history_sections_cache', get_enums(HISTORY_TABLE, 'section'), true);
    }

    $conf['history_sections_cache'] = safe_unserialize($conf['history_sections_cache']);

    if (in_array($page['section'], $conf['history_sections_cache']))
    {
      $section = $page['section'];
    }
    elseif (preg_match('/^[a-zA-Z0-9_-]+$/', $page['section']))
    {
      $history_sections = get_enums(HISTORY_TABLE, 'section');
      $history_sections[] = $page['section'];

      // alter history table structure, to include a new section
      pwg_query('ALTER TABLE '.HISTORY_TABLE.' CHANGE section section enum(\''.implode("','", array_unique($history_sections)).'\') DEFAULT NULL;');

      // and refresh cache
      conf_update_param('history_sections_cache', get_enums(HISTORY_TABLE, 'section'), true);

      $section = $page['section'];
    }
  }
```

We do as if the `history.section` is case sensitive. It's not. If you try to add `section42` in the ENUM field while `Section42` already exists, MySQL will throw an error.
--- end body ---
