Page 1 of 1

Strange View behaviour (J!1.5)

Posted: Fri Feb 22, 2008 9:13 pm
by macbloke
Hi,

I'm coding up an admin component for managing graphs and tables within the J!1.5 environment.

The component has 2 controllers - definitions and graphs.

Each controller displays their data correctly, and if you go to edit a definition, you can and you can save everything fine.

If you go to edit a graph, however, it looks like the view for the definition comes up, contains data from the definition model but displays the graph data entry form.

There are 4 models: definition, definitions, graph and graphs

There is a view for each model: definition (+tpl), definitions (+tpl), graph (+tpl) and graphs (+tpl).

There are 2 tables: definitions and graphs.

I'm a bit stumped as to how there can be any crossover between the two components.

The URL calling the edit for the definitions is:

index.php?option=com_graphmanager&controller=definitions&task=edit&cid[]=1

The URL calling the edit for the graphs is:

index.php?option=com_graphmanager&controller=graphs&task=edit&cid[]=1

Can anyone shed any light as to why a partially different view would be called? If you need to know code, please let me know.

Cheers,

StuG

Re: Strange View behaviour (J!1.5)

Posted: Sat Feb 23, 2008 10:06 pm
by macbloke
Seem to have found the source of this problem.

Turns out that the model that the view was referring to didn't have a PHP terminator at the end of it.

I had:

Code: Select all

<?php

class ComponentModelView extends JModel
{

     //Code in here

}
when I should have had:

Code: Select all

<?php

class ComponentModelView extends JModel
{

     //Code in here

}
?>
This solved the problem. Bizarre. Is this normal or was this a one off?

Cheers,

StuG