In your rules do you have mm_widget_showimagetvs?
If so, does the problem happen if you comment it out?
<?php
//---------------------------------------------------------------------------------
// mm_widget_showimagetvs
// Shows a preview of image TVs
// Emulates showimagestv plugin, which is not compatible with ManagerManager
//---------------------------------------------------------------------------------
function mm_widget_showimagetvs($tvs='', $w=300, $h=100, $thumbnailerUrl='', $roles='', $templates='') {
global $modx, $content;
$e = &$modx->Event;
if (useThisRule($roles, $templates)) {
$output = '';
$site = $modx->config['site_url'];
if (isset($w) || isset($h)) {
$w = isset($w) ? $w : 300;
$h = isset($h) ? $h : 100;
$style = "'max-width:{$w}px; max-height:{$h}px; margin: 4px 0; cursor: pointer;'";
} else {
$style = '';
}
// Does this page's template use any image TVs? If not, quit now!
$tvs = tplUseTvs($content['template'], $tvs, 'image');
if ($tvs == false) {
return;
}
$output .= "// ---------------- mm_widget_showimagetvs: Add image preview ------------- \n";
// Go through each TV
foreach ($tvs as $tv) {
$new_html = '';
$output .= '
// Adding preview for '.$tv['name'].'
$("#tv'.$tv['name'].'").bind( "change load", function() {
// Get the new URL
$(this).addClass("imageField");
var url = $(this).val();
url = (url != "" && url.search(/http:\/\//i) == -1) ? ("'.$site.'" + url) : url;
';
// If we have a PHPThumb URL
if (!empty($thumbnailerUrl)) {
$output .= 'url = "'.$thumbnailerUrl.'?src="+escape(url)+"&w='.$w.'&h='.$h.'"; ' . "\n";
}
$output .= '
// Remove the old preview
$("#'.$tv['name'].'PreviewContainer").remove();
if (url != "") {
// Create a new preview
$("#tv'.$tv['name'].'").parents("td").append("<div class=\"tvimage\" id=\"'.$tv['name'].'PreviewContainer\"><img src=\""+url+"\" style=\""+'.$style.'+"\" id=\"'.$tv['name'].'Preview\"/></div>");
// Attach a browse event to the picture, so it can trigger too
$("#'.$tv['name'].'Preview").click( function() {
BrowseServer("tv'.$tv['name'].'");
});
}
}).trigger("load"); // Trigger a change event on load
';
}
$output .= '
// If we have imageTVs on this page, modify the SetUrl function so it triggers a "change" event on the URL field
if (typeof(SetUrl) != "undefined") {
OriginalSetUrl = SetUrl; // Copy the existing Image browser SetUrl function
SetUrl = function(url, width, height, alt) { // Redefine it to also tell the preview to update
OriginalSetUrl(url, width, height, alt);
$(".imageField").trigger("change");
}
}
';
$e->output($output . "\n");
}
} // end of widget
?>
I can’t remember exactly where the fix for this was... Try replacing the contents of /assets/plugins/managermanager/widgets/showimagetvs/showimagetvs.php with:
SQL: SELECT name FROM `DBxxxxx`.`modx_site_tmplvars` tvs LEFT JOIN `DBxxxxx`.`modx_site_tmplvar_templates` rel ON rel.tmplvarid = tvs.id WHERE 1=1 AND type IN (’image’) AND rel.templateid =
Yes, that’s solved too... I don’t have version control so I don’t know which files fixed it. I’ll see about putting out a new release which doesn’t have these issues...
Hi!
What about problem
SQL: SELECT name FROM `DBxxxxx`.`modx_site_tmplvars` tvs LEFT JOIN `DBxxxxx`.`modx_site_tmplvar_templates` rel ON rel.tmplvarid = tvs.id WHERE 1=1 AND type IN (’image’) AND rel.templateid =
Is it solved? It seems that problem is in mm_widget_showimagetvs() rule when it’s applied to template without any image TV. Try last code from previouse post, it have no effect.
Quote from: ncrossland at Aug 20, 2008, 10:38 AM
Try removing the "break;" and seeing if it works now...
i’ve done so -- no change that i can see.
Quote from: skt at Aug 20, 2008, 02:30 PM
Quote from: ncrossland at Aug 20, 2008, 10:38 AM
Try removing the "break;" and seeing if it works now...
i’ve done so -- no change that i can see.
hi again, any additional thoughts on my problems? i’d love to be able to use this to organize all the template variables into tabs.
many thanks,
ST
I’m having trouble reproducing your problem -- I’ve tested, and can move multiple TVs to tabs. What language are you using?
// Hide Content section for templates that do not use it
mm_hideSections('content', '', '1,2');
// Create new tabs to organize template variable editing
$pageTabIntro = '<p>This page uses a template that defines edit-able areas. Edit these here.</p>';
mm_createTab('Page Content', 'pageTVs', '', '', $pageTabIntro);
$sbTabIntro = '<p>If you want custom sidebar text for this page only, edit sidebar content here. Note that the change will not be made on all pages -- for that, you must make edits in the Chunks section.</p>';
mm_createTab('Sidebar Content', 'sbTVs', '', '', $sbTabIntro);
// Move TVs to appropriate tabs
$pageTVs = 'tvhomeText, tvtagline, tvsidebarFirst, tvsidebarSecond, tvnewsitem1, tvnewsitem2, tvnewsitem3';
mm_moveFieldsToTab($pageTVs, 'pageTVs');
$sidebarTVs = 'tvsbaCustomHead, tvsbaCustomText, tvsbaSocialHead, tvsbaSocialText, tvsbbCustomHead, tvsbbCustomText, tvsbbMerchHead, tvsbbMerchText, tvsbbXmasCDHead, tvsbbXmasCDText';
mm_moveFieldsToTab($sidebarTVs, 'sbTVs');
This discussion is closed to further replies. Keep calm and carry on.