Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS

[eluser]Phil Sturgeon[/eluser]
[quote author="ray73864" date="1243658222"]doesn't seem to have fixed it, when i put that in it stopped all the websites from working, so i then proceeded to set up a vhost for pyrocms to be 'pyrocms.rayherring.net' and then put the url rewrite into a

Code:
$HTTP["host"] == "pyrocms.rayherring.net" {
url.rewrite = (

    "modules/(.+)/controllers/(.+)\.php$" => "/index.php/$1/$2",
    "controllers/(.+)\.php$" => "/index.php/$1",

    "^(.*)$" => "index.php/$1"
)
}

and all i get now is a 404 page if i browse to http://pyrocms.rayherring.net/index.php or an 'It Works' if i leave off the index.php[/quote]

Sorry dude, I do not know enough about lighthttpd to help out much on this one. If I get a chance I will try and set up an environment for this but I can't set a timescale for that as right now things are a bit crazy.


[quote author="Jaggy" date="1243699601"]the issues i got for now is in the product modules with that configuration .. the image doesn't shows up. i will try to fix this later.

the photo are uploaded in the asset/img/products folder .. but somehow the src tag is pointing to a wrong file name. what's in product folder is Photo_4_thumb.jpg and the final html code is <img src="/application/assets/img/products/Photo_4_home.jpg" alt="products/Photo_4_home" />[/quote]

Oh dear! I have not worked much on the products module recently so an error could have been introduced along the way. I have not been able to get GD2 working on my "built in" version of Apache on OS X so image stuff is a bit of a fail right now. Will give it a try on dev.pyrocms.com.

Ticket 41: Products module image upload

[quote author="ray73864" date="1243780056"]this is gonna sound stupid, but how do you actually create a new 'admin' account? I logged in as the demo user, clicked on 'Users', went to add a new user, but know-where could i find how you turn that user account into an admin account.[/quote]

Not stupid at all, I messed up badly there. I used to have create and edit view files, now I have only "form.php". When I merged the files it looks like I overlooked the role field. It has been added back and pushed to master.


[quote author="ray73864" date="1243780056"]Also, when creating a new navigation link, could the auto-addition of 'http://' be removed (or atleast made optional?), as i am trying to add a new link to a telnet address, since the website is for a text-based game, but it keeps appending 'http://' to the beginning of it (causing it to become: http://telnet://stf.mushhosting.net:1701)[/quote]

Fixed that. It was using the CodeIgniter prep_url function which restricts only the http:// protocol. I considered extending the function to check for any protocol but instead I just inserted http:// to the input box by default and then after that PyroCMS doesnt give a damn what you enter.

The whole navigation section needs to be revisted. Right now it is not much of a clean solution and a very unintuative interface.

[quote author="ray73864" date="1243780056"]Another problem i have found ( maybe it is because i am trying to edit the 'home' page using the demo account ) is that when i go to the 'pages' and click 'edit' for the home page, it shows the modifications i have made to it, and apparently saves it to the DB (i have checked the DB, it is definately being saved correctly), however when i go to view the home page on the website, it still shows the default message about making changes to the site please bookmark and look back later.[/quote]

Good to hear caching is working but shame to hear its not wiping. The following line in the admin controller should sort it out but seems not:

Code:
$this->cache->delete('pages_m');

Not sure about that one, works ok for me... Could you run ls -laR application/cache and pastebin me the results?

[eluser]ray73864[/eluser]
results of ls -laR:

http://pastebin.com/m379e718b

and thanks for the role fix and the http:// fix, is there any other changes between the previous version and the new one? or can i just grab the necessary updated file(s) and upload them to the webhost?

[eluser]Phil Sturgeon[/eluser]
Yeah if you look at those two commits and just upload the listed files you should be ok. If anything funky starts happening upload the whole application folder again.

Not 100% here but it looks like the directories are not being chmodded when created which means when PHP tries to delete the entire pages_m cache folder it fails.

Could you test this modification for me?

Open up applications/libraries/Cache.php and on line 246 replace:

Code:
if ( ! @mkdir($test_path)) return false;

// with

if ( ! @mkdir($test_path, DIR_WRITE_MODE)) return false;

You'll want to $ rm -rf application/cache/pages_m then test making changes to the page a few times to see if it keeps up.

[eluser]ray73864[/eluser]
Hi Phil,

The Role change and Navigation charge are awesome man, i now have my second user account and the telnet:// link is working perfectly.

Made the change to Cache.php in app/libraries, deleted the pages_m folder, however it still isn't working properly, i changed the home page text to something else, viewed the page and it showed the new home page, but then when i went to change the info again, it saved fine but it didn't update the page cache.

Another bug i just found, i logged in as my new admin account, went into 'Users', clicked on the checkbox next to 'Demo User' and then clicked the 'Delete' button at the bottom of the page and it came up with

Quote:Error

You need to select users first.

[eluser]Phil Sturgeon[/eluser]
Taken care of the user deleting. I have made a few app-wide sweeping changes recently that seem to have left a few bugs in the lesser tested modules.

I am very grateful for the bug reporting ray, you are doing a damn good job. :-)

As for the cache deleting, enable error logging and tail the logs for Cache related errors. Set the log level to 4 and to cut down on the feedback modify the command in that article to:

Quote:$ tail -f ./codeigniter/logs/log-YYYY-MM-DD.php | grep MP_Cache

[eluser]ray73864[/eluser]
ok, i have set the log level and run the tail command. I then refreshed the home page to get a log entry, went into the admin section and altered the page then clicked save, then refreshed the home page, then altered the page again and refreshed the home page.

the logfile has things like 'file written: frontendNavigation, but it only ever retrieves a page, it never seems to write a new page cache.

tail output

Code:
[domain2195672@ssh-gw-5 htdocs]$ tail -f ./codeigniter/logs/log-2009-06-01.php | grep MP_Cache
DEBUG - 2009-06-01 00:05:11 --&gt; MP_Cache file written: application/cache/navigation_m/frontendNavigation-40cd750bba9870f18aada2478b24840a.cache
DEBUG - 2009-06-01 00:05:11 --&gt; MP_Cache retrieved: pages_m/getBySlug-e0b67c4848be2b22af2010244357a2eb
DEBUG - 2009-06-01 00:05:35 --&gt; MP_Cache retrieved: modules_m/getModules-dc9cd8dbe69df4060cca2c536d3e7db8
DEBUG - 2009-06-01 00:05:35 --&gt; MP_Cache retrieved: modules_m/getModules-dc9cd8dbe69df4060cca2c536d3e7db8
DEBUG - 2009-06-01 00:05:39 --&gt; MP_Cache file written: application/cache/navigation_m/frontendNavigation-40cd750bba9870f18aada2478b24840a.cache
DEBUG - 2009-06-01 00:05:44 --&gt; MP_Cache retrieved: modules_m/getModules-dc9cd8dbe69df4060cca2c536d3e7db8
DEBUG - 2009-06-01 00:06:02 --&gt; MP_Cache retrieved: modules_m/getModules-dc9cd8dbe69df4060cca2c536d3e7db8
DEBUG - 2009-06-01 00:06:06 --&gt; MP_Cache retrieved: modules_m/getModules-dc9cd8dbe69df4060cca2c536d3e7db8
DEBUG - 2009-06-01 00:06:22 --&gt; MP_Cache file written: application/cache/navigation_m/frontendNavigation-40cd750bba9870f18aada2478b24840a.cache
DEBUG - 2009-06-01 00:06:22 --&gt; MP_Cache retrieved: pages_m/getBySlug-e0b67c4848be2b22af2010244357a2eb
DEBUG - 2009-06-01 00:06:48 --&gt; MP_Cache retrieved: modules_m/getModules-dc9cd8dbe69df4060cca2c536d3e7db8
DEBUG - 2009-06-01 00:07:05 --&gt; MP_Cache retrieved: modules_m/getModules-dc9cd8dbe69df4060cca2c536d3e7db8
DEBUG - 2009-06-01 00:07:07 --&gt; MP_Cache retrieved: modules_m/getModules-dc9cd8dbe69df4060cca2c536d3e7db8
DEBUG - 2009-06-01 00:07:21 --&gt; MP_Cache file written: application/cache/navigation_m/frontendNavigation-40cd750bba9870f18aada2478b24840a.cache
DEBUG - 2009-06-01 00:07:21 --&gt; MP_Cache retrieved: pages_m/getBySlug-e0b67c4848be2b22af2010244357a2eb

[eluser]Phil Sturgeon[/eluser]
Not sure on this one buddy, gonna leave it for the night and see if anything comes to mind tomorrow. Best of luck though!

[eluser]ray73864[/eluser]
I shall probably just set the pages_m folder to 777 for now as a temporary fix, that should fix it.

Scratch that idea, that didn't fix it, the problem doesn't seem to be the inability to create a new cache or anything, the problem seems to be that whatever creates the cache record for a page doesn't think that anything has changed on that page.

Looking into it further, i noticed that in the admin pages controller you are doing:

Code:
$this->cache->delete('pages_m');

The cache delete function looks like this:

Code:
function delete($filename = null)
    {
        if ($filename !== null) $this->filename = $filename;
        
        $file_path = $this->path.$this->filename.'.cache';
        
        if (file_exists($file_path)) unlink($file_path);
        
        // Reset values
        $this->reset();
    }

From what i can work out about that, it checks to see if $filename is not equal to 'null' and if it isn't it sets $this->filename = the filename.

next, it creates a 'file_path' and then if that exists it unlinks it.

so in this instance, file_path would look like this: "application/cache/page_m.cache" which doesn't exist, so it doesn't unlink it. and you use
Code:
$this->cache->delete()
in 2 admin controllers (pages and news), the 'pages' one deletes the pages_m and navigation_m cache, which makes me think all those calls to the delete() function are going to fail.

Course, my understanding of the function could be wrong.

[eluser]Phil Sturgeon[/eluser]
Aha! Yes you are correct. This was meant to be possible functionality of the MP_Cache system but I have found it so full of bugs I am slowly re-coding the whole damn thing and will be releasing it as my own.

I'll add support for this when I get home from work tonight.

[eluser]Phil Sturgeon[/eluser]
Unless you have a chance to test it of course. Try this:

Code:
function delete($filename = null)
    {
        if ($filename !== null) $this->filename = $filename;
        
        $file_path = $this->path.$this->filename;
        
        if (file_exists($file_path.'.cache')) unlink($file_path.'.cache');
        elseif (is_dir($file_path)) unlink($file_path);
        
        // Reset values
        $this->reset();
    }




Theme © iAndrew 2016 - Forum software by © MyBB