Jump to content
thirty bees forum
  • 0

Question

Posted (edited)

I'm using Bootstrap 5.1 in my theme, so I need to replace

data-dismiss

by

data-bs-dismiss

in file /classes/module/Module.php

So I created a file Module.php in /override/classes/:

<?php
class ModuleOverride extends Module
{
    public function displayConfirmation($string)
    {
        // Fix Bootstrap 5, added: data-bs-dismiss
        $output = '
        <div class="bootstrap">
        <div class="module_confirmation conf confirm alert alert-success">
            <button type="button" class="close" data-bs-dismiss="alert">&times;</button>
            '.$string.'
        </div>
        </div>';

        return $output;
    }

    public function displayError($error)
    {
        // // Fix Bootstrap 5, added: data-bs-dismiss
        $output = '
        <div class="bootstrap">
        <div class="module_error alert alert-danger" >
            <button type="button" class="close" data-bs-dismiss="alert">&times;</button>';

        if (is_array($error)) {
            $output .= '<ul>';
            foreach ($error as $msg) {
                $output .= '<li>'.$msg.'</li>';
            }
            $output .= '</ul>';
        } else {
            $output .= $error;
        }

        // Close div opened previously
        $output .= '</div></div>';

        return $output;
    }
}

unfortunately override is not loaded.

When I edited directly file Module.php in /classes/module/ fix works.

Deleted cache folder and file class_index.php.

I also copy file Module.php to /override/classes/module/, but it didn't help.

It's possible to override Module.php?

 

Edited by Adik

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...