Joomla error uploading hand-coded template - joomla

I'm trying to upload my hand-coded template to Joomla 2.5.
I have moved it to the templates folder online. Now I'm trying to INSTALL it from Extension Manager > Install (I see the path to it in the textbox against the Install button). But upon clicking the button, I get this error:
-1 - An error has occurred.
Copy failed
Here's my XML file:
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="template">
<name>Travels</name>
<description>
Template for Target Travels
</description>
<files>
<filename>index.php</filename>
<filename>catergory.php</filename>
<filename>templateDetails.xml</filename>
<filename>css/template.css</filename>
<filename>css/mystyle.css</filename>
<filename>css/common.css</filename>
<filename>css/crasel.css</filename>
<filename>css/jquery.jcarousel.css</filename>
<filename>css/skin.css</filename>
<folder>css</folder>
<folder>images</folder>
</files>
<positions>
<position>breadcrumb</position>
<position>welcome</position>
<position>tour_catergory</position>
<position>left</position>
<position>right</position>
<position>top</position>
<position>user1</position>
<position>user4</position>
<position>footer</position>
</positions>
</extension>
Any idea on the cause and how to fix it?

This is usually due to permission issues with folders. In the Joomla backend go to:
Site (top menu) >> System Information >> Directory Permissions and ensure the "templates" folder is writable. Whilst you're at it, ensure all folder and files in the list are writable.
Hope this helps

If your template is already in place you should use discover install not install from directory. You have no need to copy files if the files are already where they need to be.

Related

How to run application as administrator in Qt

How can I start my Qt application as administrator or get a prompt when admin privilege is needed? I have tried everything in the posts that I could find about it and most of them are a few years old. Nothing has worked and everyone seems to have a different spin on it. I have downloaded the windows SDK to get mt.exe, created the manifest files, the RC file and every other methods including right click and set the application to start in administrator mode. Nothing has worked. I need it because a task in my program requires administrator privilege. QFile::errorString() says access denied. Does anyone know how to make this work?
Okay so I found the answer to my question. I had found some solutions before, but they were not working. I found the reason why they were not working. The reason was very stupid: It was because the folder that my files were in had a space between the first and second word like (my app) which causes an error about not being able to find the location.It should be (myapp) with no spaces. The error about location not found was only happening when trying to add the adim privileges. Otherwise everything worked fine and there were no errors. So here is the solution and make sure there are no spaces in folder names.
1) Create the rc file :Open notepad and paste the following text inside then
save the file as yourappname.rc This creates the rc
file. Put the file in the folder that has all of your sourcecode and pro
file.
#include <windows.h>
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "yourappname.exe.manifest"
2) Create the manifest file with notepad, paste the following text, and save it
as yourappname.exe.manifest and put it in the same location as above.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="2.0.0.0" processorArchitecture="X86"
name="yourappname.yourappname" type="win32" />
<description>A discription of your app</description>
<dependency />
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
3) In your pro file put the following text:
win32 {
RC_FILE = yourappname.rc
}
That's it. Now your application should start with administrator privileges.
There are similar post that describe this process too. Just make sure there are
no spaces in your folder names or it won't work. Also you MUST run qt with
administrator privileges for it to work. Right click Qt and run as
administrator before trying to compile.
Works for me (add in your_project.pro):
win32 {
CONFIG += embed_manifest_exe
QMAKE_LFLAGS_WINDOWS += /MANIFESTUAC:"level='requireAdministrator'"
}
To get the require admin prompt to display, I simply added
QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\"
to my qmake file. I use this in my projects all the time.
Easiest way is config at project Run configuration, adding this env variable:
__COMPAT_LAYER=RUNASINVOKER
then cleanup and rebuild and run again the proj, it will work.

Magento custom package not setting file permissions right

I made a custom package for Magento, I'm on 1.9.1.0. I did it from Admin package manager. I installed the package from "Magento Connect Manager", it installs without error; the only problem is that my PHP file in the package is installed with "666" permission instead "644", so it won't be run by the PHP processor, because of the faulty permission. Any idea how to fix this?
The file used to make the package had right permissions "644". The syntax of my package.xml file is correct, as far as I can tell:
<?xml version="1.0"?>
<package>
<name>Magento_Iframe_Finder</name>
<version>1.4.7.3</version>
<stability>stable</stability>
<license uri="http://www.opensource.org/licenses/OSL-3.0">OSL-3.0</license>
<channel>community</channel>
<extends/>
<summary>Magento iframe finder.</summary>
<description>Magento iframe finder.</description>
<notes>Easy to install and use</notes>
<authors><author><name>John Doe</name><user>auto-converted</user><email>johndoe#gmail.com</email></author></authors>
<date>2015-12-19</date>
<time>08:04:22</time>
<contents><target name="mageweb"><dir name="errors"><file name="iframefinder.php" hash="54abb08163b654dd08635b40220c02e2"/></dir></target></contents>
<compatible/>
<dependencies><required><php><min>4.7.1</min><max>6.8.9</max></php></required></dependencies>
</package>
Any idea if there's a "switch" that I can add to my "package.xml" file to set the right file permissions to my file?
Since nobody has an answer I found it myself.
Default Magento file permissions are: 777 for directories and 666 for files, in the "Magento Connect Manager" you can change them to 755 and eventually 644 then packages will install correctly.

Load language file during joomla (2.5) system plugin installation

I'm having a real hard time showing a localized string during the installation of a system plugin (in Joomla 2.5). The "normal" way with localized strings in the xml file doesn't seem to work, (see this other question: Language based installation description).
I now tried the way proposed there, to show the description via the install scripts. This kind of works (I can echo text successfully), however, I also can't localize there - when debugging the language it shows that the plugin.sys.ini is not loaded yet; I tried to manually load the file, but had no success with loading any of my plugin language files.
This is what I got so far (in a file named setupscripts.php):
<?php // no direct access
defined('_JEXEC') or die('Restricted access');
class plgsystemmyplgnameInstallerScript {
static function loadLanguage() {
$lang =& JFactory::getLanguage();
$lang->load('plg_system_myname', JPATH_ADMINISTRATOR);
}
function install($parent)
{
self::loadLanguage();
echo JTEXT::_("PLG_MYNAME_TEST_TEXT");
}
function uninstall($parent)
{
self::loadLanguage();
echo JText::_('PLG_MYNAME_UNINSTALL_TEXT');
}
function update($parent)
{
self::loadLanguage();
echo JText::_('PLG_MYNAME_UPDATE_TEXT');
}
function preflight($type, $parent) {}
function postflight($type, $parent) {
self::loadLanguage();
echo JText::_('PLG_MYNAME_INSTALL_TEXT');
}
}
But I only get ??PLG_MYNAME_TEST_TEXT?? ??PLG_MYNAME_INSTALL_TEXT?? (language debugging is turned on) during installation... weirdly enough, the language debug feature at the bottom of the page under "untranslated strings" shows "None" (where do the question marks then come from if not from a tried but failed translation???).
Tried some variations of it (with .sys at the end of the plugin name, since I actually think the setup strings should be in the .sys.ini file, without the second parameter (leaving it default), but no luck - no error, nothing in the log (in fact my log file isn't existing, probably there was no entry yet? can one set the log level with Joomla?). But never is there any file loaded (nothing changes under "loaded language files".
Anybody got an idea how to load the language properly?
Is there something special to consider when loading languages during setup? Why is there no error message if loading the languages fails? Do I maybe have to install the language files to a special location to get them recognized during installation? My current xml looks like this:
<extension version="2.5" type="plugin" group="system" method="upgrade">
<name>PLG_MYNAME</name>
<!-- ... author, copyright, version, .. -->
<scriptfile>setupscripts.php</scriptfile>
<files>
<filename plugin="myname">myname.php</filename>
<filename>setupscripts.php</filename>
<filename>index.html</filename>
<folder>sql</folder>
</files>
<!-- ... install->sql->file ... -->
<!-- ... uninstall->sql->file ... -->
<!-- ... update->schemas->schemapath ... -->
<languages [folder="admin"]>
<language tag="en-GB">en-GB.plg_system_myname.ini</language>
<language tag="en-GB">en-GB.plg_system_myname.sys.ini</language>
<!-- ... other languages ... -->
</languages>
<!-- ... config->fields->fieldset->field ... -->
</extension>
(the square brackes around folder="admin" are supposed to indicate that I tried both with and without this attribute. It doesn't change anything).
It only works on installation if you also copy the files to the admin language folder. If you look at the core extensions you will see that they do both. It's really a bug but that's the work around.
Finally I found out how to really do it. A thorough search in the google Joomla dev group brought up this very similar question.
Basically, the language files need to reside in a separate language folder it seems, and the files section also needs to reference them. My xml now looks like this:
<!-- ... everything else stayed the same, except: -->
<files>
<filename plugin="myplg">myplg.php</filename>
<filename>index.html</filename>
<folder>language</folder>
<folder>sql</folder>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.plg_system_myplg.ini</language>
<language tag="en-GB">en-GB/en-GB.plg_system_myplg.sys.ini</language>
<!-- .. other languages ... ->
</languages>
<!-- ... rest of the xml file ... -->
The language files are now all in separate subfolders... they get copied to the exact same location as before (administrator/language//...), but now the description from the XML is also localized!
I find it very weird that there are so many ways to specify language files, which all basically work except for the one corner case of the installation...
Hope this will help other people struggling with this!

Joomla! 2.5 language file - translate description

I create a new plugin for joomla 2.5, and in xml i use:
<description>PLG_VAR_DESC</description>
But when install, he dont show the the translation but the var on file.
<languages folder="">
<language tag="en-GB">en-GB.plg_system_name.ini</language>
<language tag="en-GB">en-GB.plg_system_name.sys.ini</language>
</languages>
<files>
<folder>images</folder>
<filename>index.html</filename>
<filename>parameters.xml</filename>
<filename plugin="plg_name">plg_name.php</filename>
</files>
I try everything but i cant put this work..
Thanks
Under the administrator panel in Joomla! you can find under Site - Global configuration - System:
This will allow you to see the Joomla! Debug console:
There you can see if the language file your are using is loaded. If it's not loaded, than your manifest file is not consistent.
I think that the problem could be solved with:
<languages folder="admin">
instead of
<languages folder="">
Also for your reference, the Joomla! documentation on "Specification of language files" may be a good read.
I found the problem.. is the name of language file. Thank's for helping me

Can't install Windows 7 gadget

I'm developing a very simple gadget for Windows 7. I have created an index.html file and a gadget.xml file, compressed them as a zip, changed the extension to gadget.
When I double click on the .gadget file I get a window telling me if I'm sure I want to install the gadget as it comes from an untrusted publisher. I click 'Install', and everything seems to be fine.
However, the gadget is not installed.
I've looked at the Event Viewer and found nothing, it just silently fails.
Anyone knows what I might be doing wrong?
Here's the gadget.xml file:
<?xml version="1.0" encoding="utf-8" ?>
<gadget>
<name>Elecciones 2011</name>
<namespace>gnuine.com</namespace>
<version>1.0.0.0</version>
<author name="whatever">
<info url="hiddenforpublicpublish" />
</author>
<copyright>2011</copyright>
<description>Description</description>
<hosts>
<host name="sidebar">
<base type="HTML" apiVersion="1.0.0" src="index.html" />
<platform minPlatformVersion="1.0" />
<permissions>Full</permissions>
</host>
</hosts>
</gadget>
You need to create a .zip which has all the files directly in it.
What you probably have done is, put index.html and gadget.xml in a folder, zipped the folder.
What really needs to be done is, select index.html, gadget.xml and other files and folder and make a .zip out of it.
This was the issue I had faced, and doing this solved the problem.
Please check if that works.
Regards
download gadget
rename to rar extension from gadget extension
go to C:\Program Files\Windows Sidebar\Gadgets
extract all rename files with the same gadget file name like "new.gadget"
move the extracted folders to that directory. (to C:\Program Files\Windows Sidebar\Gadgets)
now you are done, problem solved.
I had issues with the version number, I thought it had to be:
x.x
not
x.x.x.x

Resources