Category problem on joomla 2.5 tutorial site

For Joomla! 2.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Note: All 1.6, 1.7 and 3.5 releases have reached end of life and should be updated to 3.x.

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
andriks
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jul 12, 2012 8:41 pm

Category problem on joomla 2.5 tutorial site

Post by andriks » Thu Jul 12, 2012 8:57 pm

I have problem with category section on tutorial site :
Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 12.
(http://docs.joomla.org/Developing_a_Mod ... _-_Part_12)

In part 12 - Adding categories, i followed instructions on site to make categories for my component and everything worked fine on joomla 2.5.4. But then i upgraded joomla to 2.5.5 or 2.5.6 and when i go to categories submenu from my component backend, i do not have buttons to add, edit or delete new categories!

The only things i have is "Check in" and "Help" buttons :(

I tried to downoad demo component (Hello world) from this tutorial site, but i got the same.. no categories related buttons, so i am stucked!

Please help... i am beginer :-[

bbolli
Joomla! Explorer
Joomla! Explorer
Posts: 455
Joined: Fri Nov 11, 2011 9:43 pm
Location: Chicago, IL

Re: Category problem on joomla 2.5 tutorial site

Post by bbolli » Fri Jul 13, 2012 4:19 pm

Sounds like an ACL issue, can you post some code. Usually top right admin option buttons are generated in that views view.html.php file. Also, this could be tied to your config.xml and access.xml files in your admin root folder.

Post those files and maybe we can sort this out for you.

andriks
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jul 12, 2012 8:41 pm

Re: Category problem on joomla 2.5 tutorial site

Post by andriks » Fri Jul 13, 2012 7:52 pm

My files are practicly identical to those on http://docs.joomla.org mentioned before. I only changed class and file names (to fit my semantical needs).

But as i said (correct me if i am wrong), even tutorial component has this problem (maybe outdated code). I tried to install it on 2 different 2.5.6 joomlas (on different servers) and i got the same problem. You can see the code of that tutorial component and even download .zip file on http://docs.joomla.org/Developing_a_Mod ... _-_Part_12 on the bottom of the page. And, becouse i made my component step by step according to that tutorial, my component behaves the same.

Also, i dont have access.xml and config.xml is identical like on above mentioned site.

If you anyway want to see my code i will post it.

Thanks.

bbolli
Joomla! Explorer
Joomla! Explorer
Posts: 455
Joined: Fri Nov 11, 2011 9:43 pm
Location: Chicago, IL

Re: Category problem on joomla 2.5 tutorial site

Post by bbolli » Fri Jul 13, 2012 8:24 pm

Well, the fact the upgrade broke functionality probably means the new version fixes a loophole which has yet to be corrected on the online tutorial. A couple of things:

1) You have access to the apache2 logs? Invaluable tool as it will tell you which file and line warnings and errors occur at.
2) Did you copy paste or type the code fresh? Either way, 9 times out of 10 when I have an error resulting from converting a tutorial or existing extension it is tied to a typo. The prefix for all classes must be identical to your component's name after the com_ with CamelCasing and the postfix must be same for the entire MVC path of classes.
3) I'm taking what you said literally about the access.xml and config.xml files being identical, as you do need to make minor edits. The access.xml <access> tag has a component attribute which needs to match the name of your component. Something similar need to be done to config.xml under the rules field attribute component. Since when you select the categories option, your component is actually rendering the core Joomla categories extension for the final html, the issue cannot be tied to anything beyond the controller. Let me know if you had made those changes to the access.xml and config.xml files, if not; try editing and let me know if you see the buttons.

If not, this could get a little hairy!

andriks
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jul 12, 2012 8:41 pm

Re: Category problem on joomla 2.5 tutorial site

Post by andriks » Fri Jul 13, 2012 9:51 pm

Sorry, i was a little unclear.
I have config.xml in my admin root folder and i changed it accordingly.
Maybe i miss something but there is nothing like "rules field attribute" in it :S
Here it is...

<?xml version="1.0" encoding="utf-8"?>
<config>
<fieldset
name="option 1"
label="COM_EVENTADS_CONFIG_GREETING_SETTINGS_LABEL"
description="COM_EVENTADS_CONFIG_GREETING_SETTINGS_DESC"
>
<field
name="show_category"
type="radio"
label="COM_EVENTADS_EVENTADS_FIELD_SHOW_CATEGORY_LABEL"
description="COM_EVENTADS_EVENTADS_FIELD_SHOW_CATEGORY_DESC"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
</config>

And about access.xml... i simply dont have that one file in my component dirs. I have looked on tutorial site, and on step 12 (Adding categories) that file wasnt presented yet (but maybe is later as tutorial progress..)

I will try to get apache logs as well and if i find somethin i'll let u know.

bbolli
Joomla! Explorer
Joomla! Explorer
Posts: 455
Joined: Fri Nov 11, 2011 9:43 pm
Location: Chicago, IL

Re: Category problem on joomla 2.5 tutorial site

Post by bbolli » Fri Jul 13, 2012 10:04 pm

Not having the access.xml file is definitely part of, if not THE problem. Without this file, Joomla has no place to store permissions you assign through ACL to who can and cannot do the requested task. If the file isn't there, Joomla just assumes no.

Add this file (be sure to change the 'com_helloworld' to your components name) in the com_helloworld/admin root, package, install and you should be good to go.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<access component="com_helloworld">
	<section name="component">
		<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
		<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
		<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
		<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
		<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
		<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
		<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
	</section>
	<section name="category">
		<action name="core.create" title="JACTION_CREATE" description="COM_CATEGORIES_ACCESS_CREATE_DESC" />
		<action name="core.delete" title="JACTION_DELETE" description="COM_CATEGORIES_ACCESS_DELETE_DESC" />
		<action name="core.edit" title="JACTION_EDIT" description="COM_CATEGORIES_ACCESS_EDIT_DESC" />
		<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
		<action name="core.edit.own" title="JACTION_EDITOWN" description="COM_CATEGORIES_ACCESS_EDITOWN_DESC" />
	</section>
</access>
Also, do you have a development machine or WAMP/XAMP which you test things on? Just curious, as I know when I took an old PC I had (single core with 1gb of memory), installed and configured Ubuntu Linux Server and used as a dedicated development machine; that significantly improved my process. Not only because I learned how things work beyond the scope of my websites sandbox, but having a constant, live stream of my apache2 error log running (tail -f /var/logs/apache2/error.log) for me to immediately see which file, class and line number caused the Fatal Error... well, I couldn't properly explain the amount of time and frustration that's saved me, and it cost me nothing but some time and a little effort. Just a side note...

andriks
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jul 12, 2012 8:41 pm

Re: Category problem on joomla 2.5 tutorial site

Post by andriks » Sun Jul 15, 2012 4:15 pm

Thanks man, it did the trick ;)
I added access.xml and modified it to meet my needs and its ok now, i got my buttons back ;)

Thanks also for advise, i got WAMP for local testing and its fine. Logs and setting on reach of the hands :)
I also installed J!Dump component/plugin as i found it looking for answers thrughout the internet.

And now.. :) .. i bumped on new problems .. but it would be an offtopic if i ask it on this thread..
Can i send u one more question on PM (if it exists on this forum) please ?

Thanks again.

bbolli
Joomla! Explorer
Joomla! Explorer
Posts: 455
Joined: Fri Nov 11, 2011 9:43 pm
Location: Chicago, IL

Re: Category problem on joomla 2.5 tutorial site

Post by bbolli » Mon Jul 16, 2012 4:17 pm

No problem, you can PM me through Joomla forums if you like with your additional question. Glad you got it working.


Locked

Return to “Joomla! 2.5 Coding”