4 users online. Create an account or sign in to join them.Users

Announcement

Symphony's issue tracker has been moved to Github.

Issues are displayed here for reference only and cannot be created or edited.

Browse

Closed#445: Adding select box link results in error

Using the latest code from integration, I get the following error when adding a select box link field:

Fatal error: Call to a member function query() on a non-object in /Users/nilshoerrmann/Sites/Github/symphony-2/extensions/selectbox_link_field/fields/field.selectbox_link.php on line 379

It seems like this extension does not make use of Administration::instance() and thus fails.

It seems like all database related actions fail. There are also problems in the publish area:

Fatal error: Call to a member function fetch() on a non-object in /Users/nilshoerrmann/Sites/Github/symphony-2/extensions/selectbox_link_field/fields/field.selectbox_link.php on line 286

Committed 931c248ff03888a3bedad70ddcbf86d5898ef54a

It seems like this extension does not make use of Administration::instance() and thus fails.

Using _engine->Database variable, which is more secure in this case.

Why is it more secure to use _engine->Database?
And if this is true, why are we using Administration::instance() throughout the system?

AFAIK some functions are executed by data sources and events, which is the Frontend environment. Please, correct me If I’m wrong.

Actually both are secure but the _engine variable automatically identifies the current environment and calls the instance() function appropriately.

We should decide how to handle this consistently. Symphony 2.2 will introduce the usage of Administration::instance() and Frontend::instance() all over the system. Would Symphony->Database be appropriate in this context?

Would Symphony->Database be appropriate in this context?

Exactly, yes. It should be best to use one of the three static accessors to the database. But in this case Administation::instance should work, since a extension’s install method is called in the context of the backend. Sounds like a bug elsewhere to me.

I just tried it locally and Administration::instance() seems to work perfectly.

This has already been pulled into the integration branch of the extension: https://github.com/symphonycms/selectbox_link_field/commit/931c248ff03888a3bedad70ddcbf86d5898ef54a

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details