Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetXml does not do file exist checks #323

Closed
n00dles opened this issue Nov 2, 2012 · 10 comments
Closed

GetXml does not do file exist checks #323

n00dles opened this issue Nov 2, 2012 · 10 comments
Assignees
Milestone

Comments

@n00dles
Copy link
Contributor

n00dles commented Nov 2, 2012

You get errors about files not existing because getxml doesn't check first.

For example update php check for user.xml legacy causes error

Original issue: http://code.google.com/p/get-simple-cms/issues/detail?id=323

@n00dles
Copy link
Contributor Author

n00dles commented Nov 2, 2012

From tablatronics on May 19, 2012 14:39:26
oops

getXML() doesnt check fileexists before file_contents
and somehow it gets there after file exists check.

http://get-simple.info/forum/post/27280/#p27280

@n00dles
Copy link
Contributor Author

n00dles commented Nov 2, 2012

From ccagle8 on June 14, 2012 12:55:48
i think update.php is not used very much anymore (since it's used to upgrade from 2.x to greater)

But it looks like the bigger problem is that getXML needs that filecheck. That is fine

@tablatronix
Copy link
Member

Either we put file checks in getxml, we should it loads the file, or always check before.
The latter sounds like a pita.

@ghost ghost assigned tablatronix Nov 11, 2012
@tablatronix
Copy link
Member

Added error suppression for now. We do not need the extra io of file checks for this negligible edge case.

@tablatronix
Copy link
Member

Fix the actual issues with getXMl and XMLsave now so we can remove supression, also add xml valid checking to XMLsave().

getXML fatal fails if non existant file.
XMLsave fatal fail if problem with path, non existant dir, or bad xml

@aoloe
Copy link

aoloe commented Feb 8, 2013

btw, i think that it's not XMLsave that should check if file is writable, but my code.
in my case i was checking for it (and behaving according to it...)
just letting XMLsave to crash is fine for me. really.

@tablatronix
Copy link
Member

Well that is why it now has success status, but thats not the problem the problem is some of our upgrade and install processes. Which is why it was supressed to begin with. Now they have to be rewritten to correct this workaround.

ref. upgrade error by marcco

small bug foung when debugging other things:

Warning: file_get_contents(/var/www/mysite/data/other/user.xml):
failed to open stream: No such file or directory in /var/www/mysite/admin/inc/basic.php on line 257
and in fact there's no user.xml file inside data/other but there's a directory named users with all username.xml inside

@aoloe
Copy link

aoloe commented Feb 9, 2013

btw, currently, if the page's xml file is locked, GS just does not save it without warning...

p.s.: not locked, not writable... sorry.

@tablatronix
Copy link
Member

ref. #340

@tablatronix
Copy link
Member

#570 added these functions, error handling will be handled with a new save_file function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants