WebsiteBaker Community Forum

WebsiteBaker Support (2.13.x) => General Help & Support => Hilfe & Support (deutsch) => Topic started by: peitman on March 09, 2021, 01:08:11 PM

Title: Update auf 2.13.0 r31
Post by: peitman on March 09, 2021, 01:08:11 PM
Hallo zusammen,

nach Update auf 2.13.0 r31 siehht mein Backed etwas komisch aus!

Der Addon File Editor v3.1.2 zeigt folgende Meldung an:
There was an uncatched exception
Class 'Twig_Loader_Filesys tem' not found
in line (49) of (/modules/AddonFileEditor/tool.php):

Heute ist irgendwie der Wurm drin!

Title: Re: Update auf 2.13.0 r31
Post by: dbs on March 09, 2021, 01:19:18 PM
Hallo, bitte erst mit der aktuellen Revision (r48) probieren.
http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php (http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php)
Und STRG+F5 nicht vergessen, falls etwas komisch aussieht.
Title: Re: Update auf 2.13.0 r31
Post by: peitman on March 09, 2021, 01:39:51 PM
Hallo dbs,

Update auf r48  durchgeführt.
Das backend sieht immer noch unveränder aus wie vor dem Update
Title: Re: Update auf 2.13.0 r31
Post by: hgs on March 09, 2021, 02:04:56 PM
Das ist der Sche.... Cache
Bitte einmal STRG+F5 und die BE-Welt sieht wieder super aus
Wie dbs schon geschieben hat.
Title: Re: Update auf 2.13.0 r31
Post by: DarkViper on March 09, 2021, 02:12:15 PM
Ih glaube, es wäre ein klitzeklein wenig too much, wenn mit jedem kleinen Revisionsupdate (Bugfix) des Codes auch gleich Designänderungen einzuarbeiten, die nicht zwingend notwendig sind.  :evil:
Title: Re: Update auf 2.13.0 r31
Post by: ruebenwurzel on March 09, 2021, 02:14:25 PM
Hallo,

bedingt durch die Aktualisierung der Twig-Version sind an Modulen, die Twig benutzen, ein paar Änderungen durchzuführen. Was zu tun ist, ist in der CHANGELOG von WB beschrieben:
Code: [Select]
- Twig updated to version 3, Twig Version 3.x Migration von Version 1.x. oder 2.x
        Remove Twig Autoloader in your add-on
          Twig_Autoloader::register();
        search for
          $loader = new Twig_Loader_Filesystem(..)
        change to
          $loader = new \Twig\Loader\FilesystemLoader(..)
        search for
          $twig = new Twig_Environment(...)
        change to
          $twig   = new \Twig\Environment(...)
        search for
          $twig->addFilter(new Twig_SimpleFilter('strftime', 'strftime_filter'));
        change to
          $twig->addFilter(new \Twig\TwigFilter('strftime', 'strftime_filter'));
        search for
          $tpl = $twig->loadTemplate(...)
        change to
          tpl = $twig->load(...)

Betrifft in deinem Fall wohl den AFE.

Gruß
Matthias
Title: Re: Update auf 2.13.0 r31
Post by: hgs on March 09, 2021, 02:18:36 PM
Hallo zusammen,

Der Addon File Editor v3.1.2 zeigt folgende Meldung an:
There was an uncatched exception
Class 'Twig_Loader_Filesys tem' not found
in line (49) of (/modules/AddonFileEditor/tool.php):


Für die WB 2.13 gibt es angepasste Module, so auch der AFE ich hänge ihn mal hier ran, gilt aber nur für WB 2.13 !!
Title: Re: Update auf 2.13.0 r31
Post by: hgs on March 09, 2021, 03:34:52 PM
Es gibt schon einige Module die für die 2.13 und php7.4 gefixt sind.
Melde dich hier an
https://addon.WebsiteBaker.org/account/signup.php
Dann bekommst du Zugang zur "Terser Area Tester Area"
Hier sind alle gefixten Module zum download aufgelistet.
Title: Re: Update auf 2.13.0 r31
Post by: crnogorac081 on May 10, 2021, 12:34:12 PM
Hello,

Is there a possibility to use variable instead of .twig file. For example instead to load  modify.twig file to use content from variable (template design stored and edited in database, instead of phisical file ?

Hallo,

bedingt durch die Aktualisierung der Twig-Version sind an Modulen, die Twig benutzen, ein paar Änderungen durchzuführen. Was zu tun ist, ist in der CHANGELOG von WB beschrieben:
Code: [Select]
- Twig updated to version 3, Twig Version 3.x Migration von Version 1.x. oder 2.x
        Remove Twig Autoloader in your add-on
          Twig_Autoloader::register();
        search for
          $loader = new Twig_Loader_Filesystem(..)
        change to
          $loader = new \Twig\Loader\FilesystemLoader(..)
        search for
          $twig = new Twig_Environment(...)
        change to
          $twig   = new \Twig\Environment(...)
        search for
          $twig->addFilter(new Twig_SimpleFilter('strftime', 'strftime_filter'));
        change to
          $twig->addFilter(new \Twig\TwigFilter('strftime', 'strftime_filter'));
        search for
          $tpl = $twig->loadTemplate(...)
        change to
          tpl = $twig->load(...)

Betrifft in deinem Fall wohl den AFE.

Gruß
Matthias
Title: Re: Update auf 2.13.0 r31
Post by: CodeALot on May 24, 2021, 09:10:30 PM
Es gibt schon einige Module die für die 2.13 und php7.4 gefixt sind.
Melde dich hier an
https://addon.WebsiteBaker.org/account/signup.php
Dann bekommst du Zugang zur "Terser Area Tester Area"
Hier sind alle gefixten Module zum download aufgelistet.

Nope.
"Display name: (Full name)"
I fill out my full name.

Response:
Empty or invalid characters were found for the display name   

There are no empty characters. Nor "invalid characters".

Tried again but without spaces in my full name (which there should be, for every normal person :-)
And then it works. Weird.

And then, when I try to log on: "EXCESSIVE INVALID LOGINS" (one try).
Reloaded the site. Logged into Tester Area. Yay! Password accepted! But then...
Quote
I'm so Sorry
This shouldn't have happened.!
Sorry, you do not have permission to view this page (Tester Area)
Please try again later or go to the Home page.

Seems to me your 'restricted tester area' needs some work :)
Title: Re: Update auf 2.13.0 r31
Post by: hgs on May 25, 2021, 07:58:34 AM
Please write me a pm with which USER you log in, then I can look. Thanks
I can't find the USER CodeALot in the user management.

With my dislay name there are no problems with spaces (see attachment)
Title: Re: Update auf 2.13.0 r31
Post by: crnogorac081 on May 25, 2021, 08:54:38 AM
I created account under tester area but I cant log in too.
Title: Re: Update auf 2.13.0 r31
Post by: Luisehahne on May 25, 2021, 09:00:10 AM
I created account under tester area but I cant log in too.
You already have an account. Your last Login 2021/03/26

Dietmar
Title: Re: Update auf 2.13.0 r31
Post by: hgs on May 25, 2021, 12:44:03 PM
I created account under tester area but I cant log in too.

Do you have the same message as CodeALot?

Quote
I'm so Sorry
This shouldn't have happened.!
Sorry, you do not have permission to view this page (Tester Area)
Please try again later or go to the Home page.

I see the login data of Luisehahne confirmed in the database.
Title: Re: Update auf 2.13.0
Post by: crnogorac081 on October 19, 2021, 12:16:24 PM
Hello,

so far I have this code            

Code: [Select]
if (class_exists('\Twig\Environment') && is_readable($sAddonThemePath.'/groups.twig'))
{
// create twig template object
$loader = new \Twig\Loader\FilesystemLoader($sAddonThemePath);
$twig   = new \Twig\Environment($loader, [
'autoescape'       => false,
'cache'            => false,
'strict_variables' => false,
'debug'            => false,
'auto_reload'      => true,
]);
$aJsonRespond['out'] = $twig->render('groups.twig', $aTplData);
} else {
// Twig not exists
$aJsonRespond['out'] = '<br>TWIG is not initialized!';
}

I am wondering is there a possibility that instead
Code: [Select]
$aJsonRespond['out'] = $twig->render('groups.twig', $aTplData);
I use

Code: [Select]
$groups_twig = ' .... '; / content of  groups.twig file stored in database
$aJsonRespond['out'] = $twig->render($groups_twig, $aTplData);
So far we have modules with header/ loop/ footer that are using placeholders , but only as str_replace(vars, values , setting_field) , and twig is much more advanced.

So is there possibility to use php variable instead of file, so that template can be editable in backend ?
Title: Re: Update auf 2.13.0 r31
Post by: crnogorac081 on October 27, 2021, 11:36:33 PM
here is a solution

Code: [Select]
// Instead
echo $oTwig->render('groups.twig', $aTplData);             

// Use
$sTpl = ' template (from database etc..)';
$oTpl = $oTwig->createTemplate($sTpl);
echo  $oTpl->render($aTplData);