Welcome Guest, Not a member yet? Register   Sign In
IgnitedRecord 1.0 pre-release

[eluser]MarcoITA[/eluser]
[quote author="m4rw3r" date="1224894063"]Note to you all using SVN:
The IgnitedRecord files has been moved to: http://svn.assembla.com/svn/IgnitedRecor...itedrecord

It makes more sense to put a library in the libraries dir Smile[/quote]

Uhm... after updating to the last SVN (188) and moving the autoloader string from models to libraries array I get this:

PHP Fatal error: Class 'ignitedrecord/ignitedrecord' not found in ---\system\libraries\Loader.php on line 873, referer: --hidden--
:-S

[eluser]flojon[/eluser]
Hi,
thank you for your great library!

Just updated to the latest SVN (188) and I get an error with the aliasing.
It seems the the whole AS expression is escaped:
Code:
SELECT `group`.`name AS group_name`...

which should be:
Code:
SELECT `group`.`name` AS `group_name`...

This also happens in JOIN...

Also I've created a validated behaviour and I saw that you also started working on that. :/
I haven't looked much on your code, but I choose a syntax based on validation in CakePHP (http://book.cakephp.org/view/125/Data-Validation). It's working really well.
I was thinking I would release it when it's cleaned up...

[eluser]m4rw3r[/eluser]
@MarcoITA:
What version of CI are you using? 1.7 is the one which is able to have libraries in subdirs (and if this isn't possible in the autoloader in 1.7, I think you should file it as a CI bug).

@flojon:
I think I have it fixed now, I had to improve the algorithm in _protect_identifiers() so it will recognize AS, <, >, etc.

btw, choice is always good Smile

[eluser]longlostcousin[/eluser]
hi. i was wondering if you could add to _protect_identifiers(): '<=' and '>='. i think that would be useful!

[quote author="m4rw3r" date="1224948815"]
I had to improve the algorithm in _protect_identifiers() so it will recognize AS, <, >, etc.
[/quote]

i love ignitedrecord and look forward to the continued development. many thanks! i've been using MPTtree a lot. so thanks for that too.

mark

[eluser]m4rw3r[/eluser]
Thanks for spotting those, updated IgnitedQuery::_protect_identifiers() to also recognize them (rev191).

[eluser]longlostcousin[/eluser]
wow. quick work! :-) thanks!!!

[eluser]flojon[/eluser]
rev 191 work for me again! Thanks!

[eluser]MarcoITA[/eluser]
[quote author="m4rw3r" date="1224948815"]@MarcoITA:
What version of CI are you using? 1.7 is the one which is able to have libraries in subdirs (and if this isn't possible in the autoloader in 1.7, I think you should file it as a CI bug).[/quote]

You were right, I was on 1.6.3. Updating to 1.7 fixed the subdir issue.

But looks like there's another issue with _protect_identifiers(). I get the following error when any query is sent to the db (SVN 192):

Error Number: 1054

Unknown column 'portal_pages.*' in 'field list'

Code:
SELECT `portal_pages`.`*` FROM (`portal_pages`) WHERE `nome` = 'home' LIMIT 1

The * in select is backticked while it shouldn't. The following works:

Code:
SELECT `portal_pages`.* FROM (`portal_pages`) WHERE `nome` = 'home' LIMIT 1

I've been able to try 3 different basic queries (accessing different controllers & methods directly via url) and always get the same type of problem.

edit: the issue is not INSIDE _protect_identifiers() (lines 2275-2278 should catch it) but the fact that the SQL is built without any call to teh function?! Placing a die() in it does not stop the script!

[eluser]m4rw3r[/eluser]
Are you using CI's AR to generate the queries? If so, the problem you are experiencing is expected behaviour (I have no idea to why they have made this change).
If you are using IgnitedQuery, it is a bug (but it works for me, have you updated IQ when you updated IR?).

[eluser]sophistry[/eluser]
found a bug in the new yaml feature that lets you omit the table name.

here is code to patch it. i fixed it to use the CI pluralizer as elsewhere in IR code.

at line 598... EDIT: oops, no need to load the inflector helper as it is loaded by constructor.
Code:
if( ! isset($array['table']))
            {

                // remove file extension
                $segments = explode('.', basename($filename));
                
                // grab the first part, SQL does not allow dots anyway
                $array['table'] = plural(array_shift($segments));
            }{

however, i think that may not be the end of the issue because this code would not properly handle the yaml file for linking tables. e.g., table named "groups_users" which (if there were a properly named yaml file "group_user") it would change to "group_users". EDIT: i think that's right, unless i am misunderstanding how the table and model naming convention currently works.




Theme © iAndrew 2016 - Forum software by © MyBB