Search

I have these two methods on my extension, but nothing gets appended to the head section. Also, if I call die(); on that getSubscribed… method, nothing happens, page renders normally. The extension can be installed, enabled and disabled through extension management page.

Using Symphony 2.2 beta3. And, I have been looking through Nicks entry versions extension and trying to learn… It works, mine not… :/

Code:

public function getSubscribedDelegates() {
  return array(
    array(
      'page'      => '/backend/',
      'delegate'  => 'InitaliseAdminPageHead',
      'callback'  => '__appendAssets'
    )
  );
}

public function __appendAssets($context) {

  $page = $context['parent']->Page;
  $callback = Administration::instance()->getPageCallback();

  if($page instanceof contentPublish AND in_array($page->_context['page'], array('new', 'edit'))) {
    $page->addStyleSheetToHead(URL . '/extensions/hash/assets/hash.css', 'screen');
  }
}

Ok, I got it working now… I found out, that getSubscribedDelegates is run on install / enable time…

Take a look in the delegate subscription table in the database…is your subscription there?

Yes, it’s there. It works now.

Ah good.

I found out, that getSubscribedDelegates is run on install / enable time…

Yes, Symphony subscribes to the delegates when you Enable the extension, so be sure to re-enable it if you change the delegate subscriptions as you’re developing!

That last paragraph on the delegates-page should really be moved up or something. I spent a few hours scratching my head first time I encountered this…

Also this is a real pain when working on an existing site with LOTS of content and adding new functionality for an extension which is used in almost every section! - This also means you lose your content and have to reconnect/re-add the content…. :(

EDIT: Found a way to over come this - if you have direct access to the DB … take a look at your symextensions and symextensionsdelegates tables - add your delegates that you’ve added to your code to the symextensions_delegates tables and you’re all sorted!!!

This should not happen. You only need to disable/enable the extension to re-subscribe to delegate changes. This is different to uninstalling, which will delete your fields and content.

Nick… I had multiple uses of the Unique Upload Field extension in place - the system kept telling that the extension was still in use - All I was trying to do was Disable and then Enable the Unique Upload Extension.

Edit: here is the exact error message i was getting :

The field ‘field.uniqueupload.php’, provided by the Extension ‘Field: Unique File Upload’, is currently in use. Please remove it from your sections prior to uninstalling or disabling.

Fair point. I just gave this a go, and it seems you don’t actually need to disable the extension first. If you select it, and choose Enable, the delegates subscriptions will be renewed. Worth nothing for the documentation.

Edit: updated the note in the docs thread.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details