Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Section handle #3

Open
cole007 opened this issue Oct 23, 2015 · 2 comments
Open

Section handle #3

cole007 opened this issue Oct 23, 2015 · 2 comments

Comments

@cole007
Copy link

cole007 commented Oct 23, 2015

Is there any reason why the $sectionHandle variable in the plugin (line 20) is drawn from:

$sectionHandle = $section['entryTypes'][0]['attributes']['handle'];

Rather than:

$sectionHandle = $section['handle'];

It is entirely feasible that the entry type being used has a separate handle to that being used by the section.

@cole007
Copy link
Author

cole007 commented Nov 9, 2015

Not sure if related (probably) but there is an issue with this add-on whereas if a section is created after this add-on is installed then there is a problem creating new entries for that add-on.

Would it be possible to tie this into the section add/edit hook to update the preferences?

@cole007
Copy link
Author

cole007 commented Nov 9, 2015

One possible solution might be to wrap the plugin code in a conditional after fetching the settings, for example:

if (isset($settings['attributes']['sendEmail'][$sectionHandle])) {
    $sendEmail = $settings['attributes']['sendEmail'][$sectionHandle];
    …        
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant