2

Im forced to work on a site that has been built in qcodo 6 years ago. Im doing some work on it for a few years now, and got familiar with it for as much as needed. The documentation is terrible though and now Im stuck on a problem that is literally driving me crazy.

I was trying to make the menu dynamic. So I made a navigation table, exactly setup as I normally would, used the codegenerator and got my models etc made.

The thing is: It's just not working as it's used to and I have NO CLUE what the problem is.

When I use the Navigation class in QQ conditions like Im used to for example like this:

$root = Navigation::QueryArray(QQ::AndCondition(QQ::Equal(QQN::Navigation()->ParentId, $id), QQ::LessOrEqual(QQN::Navigation()->Rights, $objUser->Rights)), QQ::Clause(QQ::OrderBy(QQN::Navigation()->Position)));

the error in the title pops up. I can do Navigation::LoadAll(); and that works fine, but as soon as I try to use QQ conditions I get the error stating it cant find navigation.

I used this same process about 10 times without problems, but now it just refuses to work for me.

Really hope you guys can help me!

Hans Wassink
  • 2,529
  • 3
  • 30
  • 45
  • @Danack ! Sorry for my super late response. I normally get a mail stating that a message had been posted, but I completely missed this one. Your answer is correct. The problem was that the QQN generated file wasnt updated with the right functions. I will reward you a shitload of points, because I looked everywhere and you are literally the only spark in an otherwise completely dark Qcodo community! – Hans Wassink Jun 24 '13 at 08:54
  • That's awfully decent of you chap. – Danack Jun 25 '13 at 14:28
  • Haha. I believe in rewarding people that deserve it! – Hans Wassink Jun 25 '13 at 20:11

1 Answers1

2

The class that it's complaining about only has one reference in the core code.

QApplicationBase::$ClassFile['qqn'] = __DATAGEN_CLASSES__ . '/QQN.class.php';

You say that you're using the code generator, so I would have expected that class to have been generated.

The exact error you're seeing is Call to undefined method QQN::navigation() which means that:

i) Your code is able to find the class 'QQN'.

ii) The class 'QQN' as defined probably in the file __DATAGEN_CLASSES__ . '/QQN.class.php' doesn't contain a function called Navigation.

And if you do have a navigation table, and are running the code generator, it apparently should be able available as QQN::Navigation() , which means that either you're not running the code generator or it's not working properly.

The only way to figure this out is to step through the code generator and see why it's either not picking up your Navigation object, or why it's not being generated correctly.

Danack
  • 24,939
  • 16
  • 90
  • 122