Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer working properly on Joomla 5.x? #13

Open
morphinestyle opened this issue Dec 28, 2024 · 3 comments
Open

No longer working properly on Joomla 5.x? #13

morphinestyle opened this issue Dec 28, 2024 · 3 comments

Comments

@morphinestyle
Copy link

This is one of the very few components/code I could find online for educational purposes, I use it to learn Joomla.
Unfortunately it doesn't seem to work properly on Joomla anymore! 5 the menu item: "Hello World -> This view displays a selected message" returns this error:

0 Attempt to assign property "text" on null
Call Stack
1	()	JROOT\components\com_helloworld\src\View\Helloworld\HtmlView.php:30
2	Robbie\Component\Helloworld\Site\View\Helloworld\HtmlView->display() JROOT\libraries\src\MVC\Controller\BaseController.php:697
3	Joomla\CMS\MVC\Controller\BaseController->display()	JROOT\components\com_helloworld\src\Controller\DisplayController.php:31
4	Robbie\Component\Helloworld\Site\Controller\DisplayController->display()	JROOT\libraries\src\MVC\Controller\BaseController.php:730
5	Joomla\CMS\MVC\Controller\BaseController->execute()	JROOT\libraries\src\Dispatcher\ComponentDispatcher.php:143
6	Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch()	JROOT\libraries\src\Component\ComponentHelper.php:361
7	Joomla\CMS\Component\ComponentHelper::renderComponent()	JROOT\libraries\src\Application\SiteApplication.php:218
8	Joomla\CMS\Application\SiteApplication->dispatch()	JROOT\libraries\src\Application\SiteApplication.php:261
9	Joomla\CMS\Application\SiteApplication->doExecute()	JROOT\libraries\src\Application\CMSApplication.php:306
10	Joomla\CMS\Application\CMSApplication->execute()	JROOT\includes\app.php:58
11	require_once()	JROOT\index.php:32

With this "menu item" I should be able to understand how the Parse Url works, but unfortunately it doesn't work.
Am I doing something wrong or is the component no longer compatible with Joomla 5.x/5.2?

@robbiejackson
Copy link
Owner

robbiejackson commented Dec 28, 2024

I've tried it on Joomla 5.2.0 and 5.2.2 and it's working ok.

The error you're getting would indicate that the URL of the HTTP request is for an id of a helloworld record which doesn't exists.

So some things to check:

If you're using a menuitem then check the Link field of the menuitem and make sure that the id= parameter refers to a helloworld record that is actually in the database.

Similarly if you're not using SEF URLs, but using the Joomla internal format, then check that the id= URL query parameter refers to a helloworld record which exists in the database.

If you still can't see why it should fail you could try stepping through the Helloworld Model getItem() function.

Also check you're using the 'main' branch of the repo.

@morphinestyle
Copy link
Author

I'll try again, it's the only tutorial I found.
Thanks for posting it!

@robbiejackson
Copy link
Owner

I wrote up a module tutorial for Joomla 4+ at https://manual.joomla.org/docs/building-extensions/modules/module-development-tutorial/, so you might find that useful as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants