ant-tar / modMailchimp

modMailchimp lets you easily place a subscribe form anywhere on your website for any list you want.
7 stars 4 forks source link

manager tabs broken #15

Open photoman opened 11 years ago

photoman commented 11 years ago

Installed in Modx v: 2.2.8-pl - there seems to be an extra bracket " > " somewhere causing the tabs in the manager to not be displayed correctly. See screen shot. screen shot 2013-09-04 at 10 47 28 am

BigBlockStudios commented 11 years ago

What version of modx? I just tested it on my most recent modx [2.2.8] and do not see this behavior. Have you tried re-installing modMailchimp?

photoman commented 11 years ago

I'm running 2.2.8-pl. Yes, I've reinstalled the package. Still broken.. I also have latest versions of VersionX and CodeMirror installed via package manager.

BigBlockStudios commented 11 years ago

Took a look through the code, checked a couple other installs, I don't see anything that could be causing a problem, but if you want to send me your:

/ core / components / modmailchimp / index.php / core / components / modmailchimp / views / common / header.php

files, I can take a look,

photoman commented 11 years ago

Ok here are the files - and a screen shot of the tab when I inspect it. You can see the closing bracket > above the highlighted A tag. It seem to be closing the LI too soon. When I removed the extra bracket in the header - the tabs still didn't appear - just single empty tab.

screen shot 2013-09-04 at 1 01 35 pm I can't upload files.. here's the code:

HEADER.PHP

```
``` INDEX.PHP getOption('core_path') . '/components/modmailchimp/views/' . $view . '.php'); $tpl = ob_get_contents(); ob_end_clean(); return $tpl; } ``` } // load the lexicon // $modx->lexicon->load('modmailchimp:default'); // Setup default properties $base_path = $modx->getOption('base_path'); $core_path = $modx->getOption('core_path'); $allow_override = $modx->getOption('modmailchimp.allow_override'); $output = ''; if(!isset($snippet) || $snippet != 'message') { ``` if (!isset($in_snippet) || ($in_snippet && !$apiKey) || ($in_snippet && $apiKey && !$allow_override)) $apiKey = $modx->getOption('modmailchimp.api_key'); // Load the MailChimp API require_once $modx->getOption('core_path') . 'components/modmailchimp/MCAPI.class.php'; $api = new MCAPI($apiKey); // Load Recaptcha require_once $modx->getOption('core_path') . 'components/modmailchimp/recaptchalib.php'; if (!isset($in_snippet)) { // Init tabs $a = isset($_REQUEST['a']) ? $_REQUEST['a'] : NULL; $tabs = array('Main'); $tab_selected = isset($_REQUEST['tab_selected']) && in_array($_REQUEST['tab_selected'], $tabs) ? $_REQUEST['tab_selected'] : NULL; $tab_default = 'Main'; $valid_actions = array('fields', 'lists'); $action = isset($_GET['action']) && in_array($_GET['action'], $valid_actions) ? $_GET['action'] : NULL; $action_default = 'lists'; if (!$action) header('Location: ?a=' . $a . '&action=' . $action_default); if (!$tab_selected) header('Location: ?a=' . $a . '&action=' . $action . '&tab_selected=' . $tab_default); // Prepare data for the templates $data = array( 'action' => $a, 'error' => '', 'tabs' => array('index' => 'Main'), 'tab_selected' => $tab_selected, 'api' => &$api ); switch ($action) { case 'lists': { $data['page_title'] = 'MailChimp Lists'; $view = 'lists'; $data['lists'] = $api->lists(); break; } case 'fields': { $data['page_title'] = 'Merge Fields'; $view = 'fields'; $listId = isset($_GET['listId']) ? $_GET['listId'] : NULL; if (!$listId) $data['error'] = 'List ID must be set'; else { $data['fields'] = $api->listMergeVars($listId); if ($api->errorCode) { $ecode = trim($api->errorCode) != '' ? ' (Error code ' . $api->errorCode . ')' : ''; $data['error'] = 'Failed to load merge fields' . $ecode . '
' . $api->errorMessage; } } break; } } // Load the views $output.= load_view('common/header', $data); $output.= load_view('grids/' . $view, $data); $output.= load_view('common/footer', $data); } ``` } return $output;
photoman commented 11 years ago

It also does this to the backend. After collapsing the nav tree panels out of the way - it is in its proper place when the panels are opened again.

screen shot 2013-09-04 at 5 18 12 pm

BigBlockStudios commented 11 years ago

I've reviewed your files - they are identical to the dist files, nor can I reproduce this. Maybe a browser version? what browser, version and platform are you using? [have you tried 2.2.9 yet?]

photoman commented 11 years ago

On a Mac 10.6 is,  latest Firefox,

Sent from Yahoo! Mail on my Nexus 7!

BigBlockStudios commented 11 years ago

Seeing some interesting things. I can recreate the menu issue locally, but not in production. there seems to be a version difference between the git repo & mailchimp repo.

  • are you testing locally [i.e. a non-resolveable address]?
  • where did you get modMailchimp from, git or modx?