We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Converting EE2 extension (with settings) + FieldType

Developer Preview

Bjørn Børresen's avatar
Bjørn Børresen
629 posts
9 years ago
Bjørn Børresen's avatar Bjørn Børresen

Hi guys,

I’m trying to upgrade an extension / fieldtype combination to EE3 and I’m running into some difficulties with the settings in the extension. Probably just something stupid I missed so bear with me 😉

The extensions has a settings() array and in EE2 I used to configure it in the extensions section. So, in the extension I have set $settings_exists to ‘y’.

I was a bit confused as to what to put in the addon.setup.php file, but it does have settings so I set settings_exists = TRUE:

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

return array(
    'author'      => 'Wedoaddons',
    'author_url'  => 'http://wedoaddons.com',
    'name'        => 'SR Member for Simple Registration',
    'description' => 'Create channel entries for members',
    'version'     => '1.5',
    'namespace'   => 'Wedoaddons\SR-Member',
    'settings_exist' => TRUE,
    'docs_url' => 'http://wedoaddons.com/addon/sr-member',
    'fieldtypes' => array(
        'sr_member' => array(
            'name' => 'SR Member Link'
        )
    )
);

However, it seems this is telling EE that the FieldType should have settings, which it does not have, so I get this error:

Notice

Undefined index: settings

ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php, line 1867 show details

Warning

call_user_func_array() expects parameter 1 to be a valid callback, class 'Sr_member_ft' does not have a method 'display_global_settings'

ee/legacy/libraries/api/Api_channel_fields.php, line 399 show details

If I set it to FALSE the settings icon is removed, which makes sense - but where do I access the extension settings?

The code is here: https://github.com/bjornbjorn/sr_member.ee_addon .. there’s a feature/ee3 branch there with the EE3 code.

       
Bjørn Børresen's avatar
Bjørn Børresen
629 posts
9 years ago
Bjørn Børresen's avatar Bjørn Børresen

In case anyone came here via search and is wondering about this; extension settings won’t work in EE3 if the extension is bundled with another type of add on (ie. FieldType). The solution is to ship the extension alone and the other add ons in a different package. According to EllisLab on Slack this is something they will fix at some point.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.