Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
uri/id confusion - Bug or an Feature?
#1
I'm working at an plugin and use some code from the costumfields.php

Code:
$data_edit = array();
// get saved page data
$uri         = @$_GET['uri'];
$path = GSDATAPAGESPATH;
// get saved page data
$file = $uri .'.xml';
$data_edit = getXML($path . $file);

it works fine on the admin page. Ok, i build an function for theme-footer, added the code and tried it - it was not working. Played around for half an hour, looked at admin-header-footer.php ... found nothing ... then ... "Wait! uri? Wasn't it called id here?" - Yes! After changing uri to id it works?!

Is this an Bug or an Feature?
Reply
#2
I’d say it’s just part of old code that hasn’t been standardised yet. Chris has been doing constant work to get the same functions system-wide and variables haven’t been reassigned I guess.

Thinking about plugins it would make sense indeed to set these two query variables the same. It seems many different admin pages are already using $_GET['uri'] so it might be a good idea to switch $_GET['id']—as used when visiting the site–over to that.

You could very easily do it yourself, I actually think $_GET['id'] is only used in index.php and could easily be switched. Just keep in mind that if you were to switch this to also change the query in your root .htaccess!

(I’ll throw this in the GetSimple issue tracker for now.)
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#3
Zegnåt Wrote:I’d say it’s just part of old code that hasn’t been standardised yet. Chris has been doing constant work to get the same functions system-wide and variables haven’t been reassigned I guess.

Exactly. development took a ton of different routes to the finish line, and now, just lately I've been trying to go thru and standardize everything. This is one that has always bothered me as well.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply




Users browsing this thread: 1 Guest(s)