JoomShaper / Helix3

46 stars 37 forks source link

A bug which is present for a long time! #119

Open 01Kuzma opened 1 year ago

01Kuzma commented 1 year ago

This bug lives in a helix for a long time! Version 3.0.3, but it seems, that it doesn't matter. plugins/system/helix3/core/helix3.php

    public static function bodyClass($class = '')
    {
        $app       = Factory::getApplication();
        $doc       = Factory::getDocument();
        $language  = $doc->language;
        $direction = $doc->direction;
        $option    = str_replace('_', '-', $app->input->getCmd('option', ''));
        $view      = $app->input->getCmd('view', '');
        $layout    = $app->input->getCmd('layout', '');
        $task      = $app->input->getCmd('task', '');
        $itemid    = $app->input->getCmd('Itemid', '');
        $menu      = $app->getMenu()->getActive();
        if ($menu) {
            $pageclass = $menu->getParams()->get('pageclass_sfx');
        }

        if ($view == 'modules')
        {
            $layout = 'edit';
        }

        return 'site ' . $option
        . ' view-' . $view
        . ($layout ? ' layout-' . $layout : ' no-layout')
        . ($task ? ' task-' . $task : ' no-task')
        . ($itemid ? ' itemid-' . $itemid : '')
        . ($language ? ' ' . $language : '');
    }

This piece of code $option = str_replace('_', '-', $app->input->getCmd('option', '')); breaks a layout of any component which displays its class in the body. It changes a third-party component's underscore symbol (if it's used) to dash! For what??? Developers are open to use such a naming convention in their own components. Then the CSS styles or JS dependent plugins don't work.

For instance, Phoca Gallery uses a com_phocagallery class name in the body, it's changed to com-phocagallery!!

FIX it ASAP