modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

Cannot Select new Template for Resource #6139

Closed modxbot closed 12 years ago

modxbot commented 12 years ago

everettg_99 created Redmine issue ID 6139

I've been unable to change the template used by pages on a local install of 2.2.0-rc1 on a MAMP install.

h2. To Reproduce

Log into the manager

Edit a page

Try to change the template (e.g. select a different template, e.g. #2 instead of #1)

After the page loads, the template still remains at template #1, unchanged.

The expected result is that the template changes.

h2. Other Info

I also disabled all plugins on this just to make sure this wasn't caused by some weird event handling, but the problem remained.

I was getting this incomplete error message:

 [2011-11-25 01:15:38] (ERROR @ /path/to/html/core/model/modx/processors/resource/resourcegroup/getlist.class.php : 118) Recoverable error: Argument 1 passed to modResourceGroupResourceGetListProcessor::getRGReloadData() must be an instance of string, string given, called in /path/to/html/core/model/modx/processors/resource/resourcegroup/getlist.class.php on line 57 and defined

Note that the error message was truncated somewhere (?), but that's everything that appeared in the log. I was also disconnected from the internet and running MODX locally on my MAMP install when this occurred, but the same behavior occurred when I connected to he internet.

Here's a quick screencast: http://screencast.com/t/SbCKAed2CEni

splittingred commented 12 years ago

splittingred submitted:

I can't reproduce this at all. Can you check in latest nightly?

markand-xx commented 12 years ago

markand submitted:

Hello. Please forgive my intrusion, but i am also having this issue.

Error log is as follows:

(ERROR @ /html-path-here/core/model/modx/processors/resource/resourcegroup/getlist.class.php : 118) Recoverable error: Argument 1 passed to modResourceGroupResourceGetListProcessor::getRGReloadData() must be an instance of string, string given, called in /html-path-here/core/model/modx/processors/resource/resourcegroup/getlist.class.php on line 57 and defined

System installed on VPS, Debian 6.0 Squeeze

I am willing to give admin access (password, etc.) of my website (server even) to developers to look into this error, if it can help anyhow.

I am technically unskilled (i.e. noob) myself, so i lack even decent skill to apprehend this trouble.

I will try (when i have some free time) to install latest nightly build and will report here (will try not to forget to report here, promise).

modxbot commented 12 years ago

everettg_99 submitted:

Shaun -

I'll give it a shot -- embarrassingly, I haven't ever RTFM'd on how to install from the nightly builds. I think this is somehow intermittent -- I've been trying out 2.2.0-rc1 on a pet project site, but I'm pretty sure I was able to change the template previously. I'll see if I can narrow down the cause of this.

splittingred commented 12 years ago

splittingred submitted:

To use the nightly builds, you download from here: http://modx.com/revolution/download/nightlies/ and install, like a normal download.

modxbot commented 12 years ago

everettg_99 submitted:

Still not working. I just tried the nightly build, but I'm experiencing the same behavior. I tried flushing permissions, deleting the cache... no go. Still getting the same error:

 [2011-11-29 18:09:12] (ERROR @ /path/to/revo/core/model/modx/processors/resource/resourcegroup/getlist.class.php : 118) Recoverable error: Argument 1 passed to modResourceGroupResourceGetListProcessor::getRGReloadData() must be an instance of string, string given, called in /path/to/revo/core/model/modx/processors/resource/resourcegroup/getlist.class.php on line 57 and defined
splittingred commented 12 years ago

splittingred submitted:

Are you sure you updated correctly? Try today's nightly - I can't reproduce with that either.

modxbot commented 12 years ago

everettg_99 submitted:

I downloaded the nightly build, unzipped it, then merged the files with the existing install:

\cp -fr modx-2.2.0-dev/* ~/Sites/revo/html

Then I went through the setup process (no errors). Then I logged in as the primary admin user and tried to change the template of a resource. Same result.

Sorry, I know this is maddening if you can't reproduce it, so I spent some time hacking through the core/model/modx/processors/resource/resourcegroup/getlist.class.php file and I started logging the data. At line 57, I put in this:

            $fp = fopen('/tmp/modx.txt', 'a');
            ob_start();
            var_dump($token);
            $logme = ob_get_clean();
            fwrite($fp, $logme);
            fclose($fp);
            $rgs = $this->getRGReloadData($token);

$token DID contain a string, e.g.

4ed660b85f8765.22438923

But I thought maybe there was a problem with the function prototyping there, so I changed line 118 from :

    protected function getRGReloadData(string $token) { 

to this:

    protected function getRGReloadData($token) { 

But no dice. After doing that, I got the same result (i.e. I still couldn't change the template), but nothing got logged.

I also tried removing the @ error-suppression from the following lines within the getRGReloadData function, but still, nothing is showing up in the logs and the behavior does not change.

            $reloadData = @unserialize(reset($reloadData));
            $rgs = @json_decode($reloadData['resource_groups']);

I crawled further through that function, and I verified that it's returning an empty array, so I turned my attention back to the calling code back around line 57. Honestly, I don't know what I'm looking for, but here are a couple observations:

Right after the following lines:

        foreach ($resourceGroups as $resourceGroup) {
            $resourceGroupArray = $resourceGroup->toArray();
            $resourceGroupArray['access'] = (boolean) $resourceGroupArray['access'];

I printed out the contents of $resourceGroupArray:

Array
(
    [id] => 1
    [name] => Premium Content
    [private_memgroup] => 
    [private_webgroup] => 
    [access] => 
)

At the end of the process function, I logged the output of

$this->outputArray($list, $resourceGroupList['total'])

as the following:

{"total":"1","results":[{"id":1,"name":"Premium Content","private_memgroup":false,"private_webgroup":false,"access":false}]}

Nothing is standing out to me though... I don't know what I'm looking for.

splittingred commented 12 years ago

splittingred submitted:

The fact that this line:

protected function getRGReloadData(string $token) { 

Still exists in your downloads means that you haven't updated correctly. That line does not exist in the latest Git, or in the latest nightlies.

modxbot commented 12 years ago

everettg_99 submitted:

Hmm... then you may want to check your build script. I downloaded the nightly build again from http://modx.com/revolution/download/nightlies/, and it's clear that that function is still there:

$ grep -rl 'getRGReloadData' .
./core/model/modx/processors/resource/resourcegroup/getlist.class.php
modxbot commented 12 years ago

everettg_99 submitted:

Any update on this? I just downloaded today's nightly build (http://modx.s3.amazonaws.com/releases/nightlies/modx-2.2.0-dev-120611.zip) and it still has that function in line 120 of core/model/modx/processors/resource/resourcegroup/getlist.class.php

Is the build script wonky?

splittingred commented 12 years ago

splittingred submitted:

Yes, it has that function:

 protected function getRGReloadData($token) { 

But it does not have:

    protected function getRGReloadData(string $token) { 

which is causing your issue.

modxbot commented 12 years ago

everettg_99 submitted:

That's not the only cause of the issue -- there's something either in my environment or something caused due to the upgrade process.

I've confirmed that a FRESH install of the nightly build works as expected.

However, upgrading an existing install of 2.2.0-rc1 to the new nightly build continues to have this problem of being unable to change templates. I tried upgrading another instance of 2.2.0-rc1, and the nightly build corrected the problem. So the only environment I'm seeing this behavior is on my local MAMP environment, which was probably originally installed as 2.0.8 and then upgraded periodically. Probably impossible to troubleshoot.

modxbot commented 12 years ago

everettg_99 submitted:

For what it's worth, there was some related discussion here: http://forums.modx.com/thread/72606/couple-of-issues-with-2-2#dis-post-403849

jcamachott commented 12 years ago

john@pixelstation.com submitted:

Grrrr...ignore that, its working for me now

I have the same problem with changing templates in 2.2 RC2 however I've been able to work around it by using the Quick Update Resource.

BTW I have set date_timezone in the Settings to the same as my php.ini file