0

I have seen the earlier question on this subject and tried the suggested code:

$db = (new Joomla\Database\DatabaseFactory)->getDriver('mysqli', $options); 

but get an error:

An error has occurred with a eval'd field - please inform the web-site owner. Debug: Caught exception on eval of ElementName: Database is not available in constructor in 5.0.

I also tried:

$db = DatabaseFactory::getDriver('mysqli', $options); 

which gave the error:

Non-static method Joomla\Database\DatabaseFactory::getDriver() cannot be called statically

How should this be done?

2
  • This looks like a Fabrik error. The first piece of code works in normal J4. Commented Jan 22, 2023 at 2:21
  • Thanks for this. I have now persevered and found that the problem only occurs with eval’d code; elsewhere, Fabrik is fine with it, so I have a workaround. Fabrik4 is only in beta at the moment, so problems are not entirely unexpected. Commented Jan 24, 2023 at 14:58

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.