Daniel-KM / Omeka-S-module-CleanUrl

Displays clean and readable URLs like https://example.org/my_collection/dcterms:identifier in Omeka S.
Other
4 stars 4 forks source link

Source code bug #1

Closed hafizchin closed 4 years ago

hafizchin commented 4 years ago

Hi Daniel,

Just saw some bug in the source code.

File : /src/View/Helper/CleanUrl.php

/**
 * Normalize the controller name.
 *
 * @param string $name
 * @return string
 */
protected function controllerName($name)
{
    $controllers = [
        'item-set' => 'item-set',
        'item' => 'item',
        'media' => 'media',
        'item_sets' => 'item-set',
        'items' => 'item',
        'media' => 'media',
        'Omeka\Controller\Site\ItemSet' => 'item-set',
        'Omeka\Controller\Site\Item' => 'item',
        'Omeka\Controller\Site\Media' => 'media',
        \Omeka\Entity\ItemSet::class => 'item-set',
        \Omeka\Entity\Item::class => 'item',
        \Omeka\Entity\Media::class => 'media',
    ];
    return isset($controllers['name'])
        ? $controllers['name']
        : null;
}

"name" should be $name.

Daniel-KM commented 4 years ago

Ok, thanks.