goldsky / SmartTag

Yet Another Tagging System for MODX Revolution
4 stars 3 forks source link

MODX3 compatibility #40

Open Mark-H opened 2 years ago

Mark-H commented 2 years ago

From Slack:

Stuart McMartin 16:32 Just upgraded to 3.0.0. Smashing. Looks good. I've a problem with some resources in the Manager. Best guess is something to do with Template Vars on offending resources. And in the Error Log I get -

(ERROR @ /home/USER/apps/MyPROJECT/core/src/Revolution/modManagerResponse.php : 160) PHP warning: Invalid argument supplied for foreach()TypeError: Argument 1 passed to SmartTagInputRender::__construct() must be an instance of modTemplateVar, instance of MODX\Revolution\mysql\modTemplateVar given, called in /home/USER/apps/MYPROJECT/core/src/Revolution/modTemplateVar.php on line 473

Errors:

 SmartTagInputRender->__construct()
 MODX\Revolution\modTemplateVar->getRender()
 MODX\Revolution\modTemplateVar->renderInput()
 ResourceManagerController->loadTVs()
 ResourceUpdateManagerController->process()
 MODX\Revolution\modManagerController->render()
 MODX\Revolution\modManagerResponse->outputContent()
 MODX\Revolution\modManagerRequest->prepareResponse()
 MODX\Revolution\modManagerRequest->handleRequest()

Might be quickest solved by replacing the input constructor from:

    public function __construct(modTemplateVar $tv, array $config = array()) {

to

    public function __construct($tv, array $config = array()) {

but I haven't tested if that flags up any strict errors or if any other compatibility issues exist.

Parthian commented 2 years ago

Big improvement. Can now edit those resources. I'm using it thus: [[!getResources? &parents=3&tvFilters=SearchTags==%[[*TaggedPages]]%&tpl=tpl.getResources.MediaList&limit=0&depth=0&includeTVs=1&processTVs=1&tvPrefix=``]] So a resource can show and link to other resources with a specific tag. This isn't working but I think I've some debugging to do. Will update. Thanks Mark.