Question

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!

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top