Strange View behaviour (J!1.5)

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
macbloke
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Feb 21, 2008 10:23 am

Strange View behaviour (J!1.5)

Post by macbloke » Fri Feb 22, 2008 9:13 pm

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

macbloke
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Feb 21, 2008 10:23 am

Re: Strange View behaviour (J!1.5)

Post by macbloke » Sat Feb 23, 2008 10:06 pm

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


Post Reply