We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32344
    • 11 Posts
    Quote from: garryn at Sep 14, 2009, 01:15 PM

    Hi Andrew, that’s a strange issue indeed - looks like somehow the $modx->placeholders array is not actually an array for some reason. I’m not really sure why that would be :/

    I haven’t checked the code at all in Evo 1.0 but there is no reason why it shouldn’t work, there’s nothing that stands out to me that would need attention for newer versions of MODx.

    I’m pretty stacked out at the moment but if I can find a few minutes somewhere, I’ll try and test this out in Evo 1.0 and see if I can replicate the issue.

    hey Garry, this script is awesome I found it easy to configure and it is exactly what I have been looking for.

    I am also getting the array error message above, only periodically though. if I clear the cache and then reload the preview through the manager the error is sometimes gone and the page loads as expected, but it is also sometimes still outputting the error?.

    when it is working I can use the form and add myself to the mailchimp list with no problems.

    yet every now and then i will get the error output of .

    « MODx Parse Error »

    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: array_merge() [function.array-merge]: Argument #2 is not an array
    Error type/ Nr.: Warning - 2
    File: /home/belindad/public_html/manager/includes/document.parser.class.inc.php(770) : eval()’d code
    Line: 53

    Parser timing
    MySQL: 0.0052 s (3 Requests)
    PHP: 0.0413 s
    Total: 0.0465 s

    the page can be viewed here http://www.belindadavidson.net/27

    Things that you may want to know I am running modx 1.0.2 with PHP 5.2.10. I am also using YAMS

    I appreciate any help you can give me, the spiratic nature of this error has me stumped...
      • 32344
      • 11 Posts
      HI Garry

      I have gotten around the issue by making the page that holds the form uncacheable. I cant get it to error now at all.

      Once again thanks for making this script available. it is perfect!

      Cheers
      Pete
        • 12147
        • 182 Posts
        I have gotten as far as this message on my page:"Please specify a valid form."

        User and pass and list id are correct, I followed and checked txt directions carefully, everything is where it’s supposed to be.

        Can someone let me know how to fix?

        So near and yet so far... undecided Evo 1.0.2, "cacheable" unchecked.

        P.S. I got a lot of the parser error stuff (array2, etc), and changed [!mailchimpSubscribe?form=`mailchimpForm` &listId=`<YOUR LIST ID>`!] to [!mailchimpSubscribe?&form=`mailchimpForm`&listId=`<YOUR LIST ID>`!] Now I only get "Please specify a valid form."
          • 5340
          • 1,624 Posts
          Maybe this helps.

          I use to signup people with eForm directly into mailchimp

          1. upload mailchip api files to your server
          2. built a snippet called signUpEmail:

          include_once('mailchimp/MCAPI.class.php');
          
          function signUpEmail(&$fields){
          	
          	if($fields['signup']){
          		include_once('mailchimp/config.inc.php');
          	
          		$api = new MCAPI($apikey);
          		$merge_vars = array('');
          		
          		$retval = $api->listSubscribe( $listId, $dbTable['email'], $merge_vars, '', false, '', '', false);
          		
          		if ($api->errorCode){
          			$m = "$listId - Unable to load listSubscribe()!\n" ."\tCode=".$api->errorCode."\n" . "\tMsg=".$api->errorMessage."\n";
          			$modx->logEvent(29, 1, $m . ' ON ' .$dbTable['email'], 'MailChimp');
          		} else {
          		    //$modx->logEvent(29, 1, $retval . ' ON ' .$dbTable['email'], 'MailChimp');
          		}	
          	}
          	
          }

          Modify the above to your needs

          3. call this snippet in the eFormOnBeforeMailSent eForm event.

          [!signUpEmail!][!eForm? &formid=`***` &to=`****` &from=`**` &tpl=`***` &report=`**` &eFormOnBeforeMailSent=`signUpEmail` !]


          PS: This is not tested as my setup is a lot more complicated.
            • 32344
            • 11 Posts
            Quote from: wlhh at Feb 04, 2010, 08:28 PM

            I have gotten as far as this message on my page:"Please specify a valid form."

            User and pass and list id are correct, I followed and checked txt directions carefully, everything is where it’s supposed to be.

            Can someone let me know how to fix?

            So near and yet so far... undecided Evo 1.0.2, "cacheable" unchecked.

            P.S. I got a lot of the parser error stuff (array2, etc), and changed [!mailchimpSubscribe?form=`mailchimpForm` &listId=`<YOUR LIST ID>`!] to [!mailchimpSubscribe?&form=`mailchimpForm`&listId=`<YOUR LIST ID>`!] Now I only get "Please specify a valid form."

            have you set up the list snippet? If you have what happens when you put it on the page?

            you should get an output like the below

            Your Lists (ID => Name):
            1r7582edF2 => My cool list

            if it fails i would re look at your details in the config. if it runs then you take the id number that has been output and put it into the snippet

            so for this example it would be
            [!mailchimpSubscribe?form=`mailchimpForm` &listId=`1r7582edF2`!]

            make sure you check the field names in mailchimp by the field names you have in your mailchimpForm chunk

            also make sure your chunks name matches the name in your call, so in the above example mailchimpForm


            let us know how you go
              • 8609
              • 607 Posts
              whodaman

              Do you have your snippet call just like that -> [!mailchimpSubscribe?form=`mailchimpForm` &listId=`1r7582edF2`!]

              If I leave the & out before form then I get parse errors. So mine would be

              [!mailchimpSubscribe?&form=`mailchimpForm` &listId=`mylistid`!]

              Same thing happens if I try to put a space between the mailchimpSubscribe? and &form=`mailchimpForm`

              I’m pretty sure my ID is correct. But I still get the valid form error. Did you make any changes to the chunk code?
                • 32344
                • 11 Posts
                strange, yeah I have it exactly as per the example in the read me file (no &). the only changes I have mede to the chunks (i have 4 for different languages) is to add a language field.

                I was getting parser errors, then I cleared my cache files and they would go away, so i made the page uncachable.. not ideal but it worked. I will try add the & and have a play around

                thanks!

                here is the page in action, I am receiving subscriptions fine too. (ignore any bugs still a work in progress)
                http://www.belindadavidson.com/en/subscribe-to-newsletter.html
                  • 8609
                  • 607 Posts
                  Yeah, I checked your website earlier before I sent you a PM, so I could see the form was working fine for you and when I viewed source I saw the extra field. I have the page set to uncacheable but the errors didn’t go away until I added the & before form.

                  Really frustrating!
                    • 8609
                    • 607 Posts
                    Looking through the snippet code, it seems the snippet call is not seeing the form chunk, thus setting the value of $form to null. Not sure why this is though. I used the exact same chunk code and I got the error. I then went into the chunk code and changed the ids of the fields from FIRST and LAST to FNAME and LNAME to conform with my form on MailChimp, same error. So perhaps the problem is with the snippet call, but I can’t figure out what it could be. As stated before, if I use the call as in the readme file, I get parse errors like the posters before. If I place an & before ? and form, then the parse errors disappear but I have this valid form error.

                    Any ideas anyone?
                      • 32344
                      • 11 Posts
                      here is my exact call and chunk.

                      my call on the page
                      [!mailchimpSubscribe?form=`mailchimpNewsForm_en`&listId=`d7c8e27095`!]

                      My snippet is unchanged from the one in the package.

                      my chunk (mailchimpNewsForm_en)
                      <p>[+MailChimp.message+]</p>
                      <form method="post" action="[~[*id*]~]">
                      <label>First Name: <input type="text" name="mc_FNAME" value="" /></label>

                      <label>Last Name: <input type="text" name="mc_LNAME" value="" /></label>

                      <label>Email: <input type="text" name="mc_EMAIL" value="" /></label>

                      <label for="select">select your language</label>
                      <select name="mc_MERGE3" id="MERGE3">
                      <option value="German">german</option>
                      <option value="English" selected="selected">english</option>
                      </select>


                      <input type="submit" name="subscribe" value="Subscribe" />
                      </form>


                      hope it helps
                      Pete