I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem! Topic is solved
Moderator: ooffick
Forum rules
-
- Joomla! Intern
- Posts: 70
- Joined: Sat Feb 15, 2020 12:48 am
I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
I'm working on doing ceford's Joomla 4x Component Tutorial (https://docs.joomla.org/J4_Component_example_-_Mywalks); and ran into a problem!
I copied the github file down and tar.gz'd and extracted in /joomla4/components/com_mywalks/ & set chown -R www:www com_mywalks and then went to Admin -> Discover and selected it; clicked install and it gave me an error (I couldn't preserve the error message; however it was an xml manifest error with something regarding cannot access or find /admin/*.sql ... aborting installation).
Since then; I checked permissions and I can't get Discover to find it again on Discovery. I even removed it; copied a new one in and re-ran Discover and it won't find it.
How do I remedy this?
Does anyone know?
Best Regards,
Brandon!
Thank you for this tutorial and website community for us Joomla Users!
I copied the github file down and tar.gz'd and extracted in /joomla4/components/com_mywalks/ & set chown -R www:www com_mywalks and then went to Admin -> Discover and selected it; clicked install and it gave me an error (I couldn't preserve the error message; however it was an xml manifest error with something regarding cannot access or find /admin/*.sql ... aborting installation).
Since then; I checked permissions and I can't get Discover to find it again on Discovery. I even removed it; copied a new one in and re-ran Discover and it won't find it.
How do I remedy this?
Does anyone know?
Best Regards,
Brandon!
Thank you for this tutorial and website community for us Joomla Users!
Best Regards,
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!
#SICSEMPERTYRANNIS
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!

#SICSEMPERTYRANNIS
-
- Joomla! Hero
- Posts: 2523
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
It' an installable package. You can install it normally using Extension Manager.
If for some reason you want to use Discover Install, you need to place files from admin directory and the mywalks.xml file in administrator/components/com_mywalks, and files from site directory in components/com_mywalks.
If for some reason you want to use Discover Install, you need to place files from admin directory and the mywalks.xml file in administrator/components/com_mywalks, and files from site directory in components/com_mywalks.
-
- Joomla! Intern
- Posts: 70
- Joined: Sat Feb 15, 2020 12:48 am
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
SharkyKZ,SharkyKZ wrote: ↑Sun May 01, 2022 8:28 amIt' an installable package. You can install it normally using Extension Manager.
If for some reason you want to use Discover Install, you need to place files from admin directory and the mywalks.xml file in administrator/components/com_mywalks, and files from site directory in components/com_mywalks.
Thank you! I will give this a try and hope it resolves!

Much appreciated!
Best Regards,
Brandon
Best Regards,
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!
#SICSEMPERTYRANNIS
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!

#SICSEMPERTYRANNIS
-
- Joomla! Intern
- Posts: 70
- Joined: Sat Feb 15, 2020 12:48 am
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
SharkyKZ,
I guess I spoke too fast. It solved the variable -> value issue. However it did not install correctly. I get this error when clicking on "Components - Mywalks"
I checked the com_mywalks\ and no such folders exist. o_O
Best Regards,
Brandon
I guess I spoke too fast. It solved the variable -> value issue. However it did not install correctly. I get this error when clicking on "Components - Mywalks"
Code: Select all
An error has occurred.
0 Class "J4xdemos\Component\Mywalks\Administrator\Extension\MywalksComponent" not found
Best Regards,
Brandon
SharkyKZ wrote: ↑Sun May 01, 2022 8:28 amIt' an installable package. You can install it normally using Extension Manager.
If for some reason you want to use Discover Install, you need to place files from admin directory and the mywalks.xml file in administrator/components/com_mywalks, and files from site directory in components/com_mywalks.
Best Regards,
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!
#SICSEMPERTYRANNIS
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!

#SICSEMPERTYRANNIS
-
- Joomla! Intern
- Posts: 70
- Joined: Sat Feb 15, 2020 12:48 am
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
Do you know if this is referring to database information? I created a secondary database separate from the Joomla Installation. a) Because I didn't think about it being a problem. and b) Now that it doesn't work; I have to learn why.
This is in administrator/components/com_mywalks/
I see $name & $prefix (Doesn't look like a full sql connection string at all).
This is going to be a learning curve from standard PHP it seems.
Best Regards,
Brandon
This is in administrator/components/com_mywalks/
Code: Select all
GNU nano 5.4 MywalksController.php
/**
* Mywalks list controller class.
*
* @since 1.6
*/
class MywalksController extends AdminController
{
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config The array of possible config values. Optional.
*
* @return \Joomla\CMS\MVC\Model\BaseDatabaseModel
*
* @since 1.6
*/
public function getModel($name = 'Mywalk', $prefix = 'Administrator', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
This is going to be a learning curve from standard PHP it seems.
Best Regards,
Brandon
Best Regards,
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!
#SICSEMPERTYRANNIS
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!

#SICSEMPERTYRANNIS
-
- Joomla! Hero
- Posts: 2523
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
This method is for getting a model instance. To create a database connection use Joomla\Database\DatabaseFactory::getDriver(). You can then pass it to the model in the $config array.
- ceford
- Joomla! Ace
- Posts: 1567
- Joined: Mon Feb 24, 2014 10:38 pm
- Location: Edinburgh, Scotland
- Contact:
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
Do not use a separate database unless you know exactly what you are doing and have good reason to!
The getModel function simply tells the application to use the model found in administrator/com_mywalks/src/Model/MywalkModel.php - you can see a similar construction in com_content/src/Controller/ArticlesController.php. The only direct reference to a database table is in src/Table/xxx.php.
The getModel function simply tells the application to use the model found in administrator/com_mywalks/src/Model/MywalkModel.php - you can see a similar construction in com_content/src/Controller/ArticlesController.php. The only direct reference to a database table is in src/Table/xxx.php.
-
- Joomla! Intern
- Posts: 70
- Joined: Sat Feb 15, 2020 12:48 am
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
SharkyKZ,
Thank you ! I will learn this.
Best Regards,
Brandon
Thank you ! I will learn this.
Best Regards,
Brandon

Best Regards,
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!
#SICSEMPERTYRANNIS
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!

#SICSEMPERTYRANNIS
-
- Joomla! Intern
- Posts: 70
- Joined: Sat Feb 15, 2020 12:48 am
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
ceford,
Security is reason (It's a good one also!). Thank you again for the Tutorial and for the information you just provided me to learn.
Best Regards,
Brandon
Security is reason (It's a good one also!). Thank you again for the Tutorial and for the information you just provided me to learn.
Best Regards,
Brandon

ceford wrote: ↑Fri May 27, 2022 7:42 amDo not use a separate database unless you know exactly what you are doing and have good reason to!
The getModel function simply tells the application to use the model found in administrator/com_mywalks/src/Model/MywalkModel.php - you can see a similar construction in com_content/src/Controller/ArticlesController.php. The only direct reference to a database table is in src/Table/xxx.php.
Best Regards,
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!
#SICSEMPERTYRANNIS
Mr. Brandon Kastning
Washington State, USA
Glory to Constitutional American Republic Forever!

#SICSEMPERTYRANNIS
-
- Joomla! Apprentice
- Posts: 10
- Joined: Tue Dec 16, 2008 7:16 am
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
I'm playing with MyWalks component as well, and added button to download a report file. Could someone help with how to change Controller or Router to call FilesModel::downloadfile? I have similar working plugin in Joomla 3, and trying to learn how to do a file download in Joomla 4.
-
- Joomla! Apprentice
- Posts: 10
- Joined: Tue Dec 16, 2008 7:16 am
Re: I'm working on doing ceford's Joomla 4x Component Tutorial (com_mywalks); and ran into a problem!
I have figured it out - I just added in the Controller:
Code: Select all
public function download()
{
$cid = $this->input->get('cid');
// get file details from DB for the $cid[0] parameter, read it from disk and return
// ... omitted a few lines for brevity
header("Content-Disposition: attachment; filename=$name");
header("Content-length: $size");
header("Content-type: $type");
readfile($filePath);
}