I found a bug last night when trying to help Tatey set up a 'newsletter subscription form' page.
First off, the checkboxes for each Newsletter do not show up under the 'Specific newsletters' option in 'newsletter subscription form' page type.
Instead I get this error:
Notice: Undefined variable: nlCheckboxes in /var/www/silverstripe-gsoc/cms/code/Newsletter/SubscribeForm.php on line 92
I was able to fix that error and make the option show up by changing this line in cms/code/Newsletter/SubscribeForm.php from:
if($newsletterTypes && is_array($newsletterTypes)) {
to:
if($newsletterTypes && is_object($newsletterTypes)) {
The next problem I found was that none of the checkbox selections under the "Specific newsletters" option would be saved unless I made the following change (changing $data['CustomNewsletters'] to $_REQUEST['CustomNewsletters']):
http://www.elijahlofgren.com/silverstripe/diffs/Make-Specific-newsletters-option-work-in-Admin-Panel-only-cms-gsoc-r37164.diff
Then, the checkbox selections were saved in the Admin Panel. I did start getting these errors though:
Error in Ajax evaluator on line 974: invalid flag after regular expression
Notice: Undefined offset: 0 in /var/www/silverstripe-gsoc/cms/code/Newsletter/SubscribeForm.php on line 132
Notice: Undefined variable: has in /var/www/silverstripe-gsoc/sapphire/core/model/ComponentSet.php on line 94
Notice: Undefined variable: has in /var/www/silverstripe-gsoc/sapphire/core/model/ComponentSet.php on line 99
Notice: Undefined variable: has in /var/www/silverstripe-gsoc/sapphire/core/model/ComponentSet.php on line 99
Notice: Undefined variable: has in /var/www/silverstripe-gsoc/sapphire/core/model/ComponentSet.php on line 99
Notice: Undefined variable: removeList in /var/www/silverstripe-gsoc/sapphire/core/model/ComponentSet.php on line 105
Then I tried the frontend, and I got these errors:
Notice: Undefined variable: defaultOption in /var/www/silverstripe-gsoc/sapphire/forms/EditableRadioField.php on line 135
Fatal error: Call to a member function getRecord() on a non-object in /var/www/silverstripe-gsoc/sapphire/forms/CheckboxSetField.php on line 20
I was able to fix that fatal error with this change (adding a if ( is_object($this->form) ) statement):
http://www.elijahlofgren.com/silverstripe/diffs/Fix-CheckboxSetField-getRecord-FATAL-error-sapphire-gsoc-r37164.diff
MAIN ISSUE: However, I was unable to fix a major bug where the "Subscribe to lists" option always shows 1 less Newsletter checkbox than is selected under the "Specific newsletters" option on the backend. I tried for a long time to fix this last night, but was unable to.
Hopefully you will have more success fixing this than I did. ;)
My details:
browser, operating system: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty)
web server software, PHP version: Apache/2.2.3 (Ubuntu) PHP/5.2.1
SilverStripe version: gsoc branch revision 37164
Hope this helps,
Elijah Lofgren