Trouble Shooting Wiki

Troubleshooting Applications using Joomla with Flash

From TroubleshootingWiki

Jump to: navigation, search
Troubleshooting Applications using Joomla with Flash
Official Page
Project Documentation
Download
Source Book
200px-1847192769.jpg
ISBN 978-1-847195-34-0
Publisher Packt Publishing
Author(s) Suhreed Sarkar

Maintenance and troubleshooting are an integral part of any application. Flash applications integrated with Joomla! may also need some troubleshooting from time-to-time. This tutorial focuses on the common problems that you may face when using Flash with the Joomla! CMS. On the completion of this tutorial you will be able to troubleshoot:

  • Common problems with Joomla!
  • Common problems with Flash
  • Joomla! extensions used in this book

Troubleshooting is largely dependent on the actual environment around it. However, we will examine some of the common scenarios where you may face some problems when using Flash with Joomla!. These cases are illustrative, and you may find other kinds of problems too. The best way of finding solutions in such cases would be to consult relevant websites and forums.

Contents

[edit] Issues related to Joomla!

The best place to search for solutions for problems related to Joomla! is the Joomla! forum at http://forum.joomla.org. First, search the forum for the problem and its solution. If you do not find a similar problem reported, then register with the forum and post the problem to the forum. As the Joomla! community is very large, you may expect to get the solution quickly. The more descriptively and clearly you report your problem, more are the chances of getting the correct solution quickly.

The Joomla! forum has many sections, and it is convenient to browse to the relevant sections. For example, if you suspect that the problem on your Joomla! site has been caused by a particular component, then visit the Extensions | Components section of the Joomla! forum.

[edit] Problems with installation of extensions

In Joomla! 1.5, you can install all the extensions from one place, Extensions | Install/Uninstall. However, in Joomla! 1.0.x, you need to select different screens based on the type of extension you are going to install. This used to create a lot of trouble in installation of extensions as some of the administrators were installing modules from the component installation screen. Joomla! 1.5.x eliminates such confusion. However, you may still face some problems while installing extensions.

The following are some of the common errors that occur during the installation of extensions:

  • You may get an error message saying that direct access to a directory is not possible. This happens mainly due to inappropriate permissions to the directory or a Joomla! installation with inappropriate access rights. You can solve this problem by setting appropriate permissions for the directory; especially the write permissions to the group in the component and template installation directories.

For some extensions, you may be warned that the extension is written for an earlier version of Joomla!, so you will need to enable the System - Legacy plugin to work with it. This happens if you try to install an extension marked as '1.5 legacy mode'. You must enable the System - Legacy plugin from Extensions | Plugin Manager to run such type of extensions.

  • While installing some extensions, you may be notified that another template/component/module/extension is in the same location. This happens if you have already installed the extension, or there is another extension with the same name. To solve this problem, first uninstall the previously installed extension, and then try installing it again. If you cannot uninstall the extension from the Joomla! admin area, then login to cPanel and delete the respective folder, for example ./administrator/components/com_links, from the web server.
  • With some extensions you may get an error message saying that the XML setup file could not be found in the package. It may be due to the fact that the XML file is corrupt, missing, or does not exist at all. To verify the package, open the zipped package file on your local computer and check if the XML file exists with the correct name and is in the correct format. You will also get this message if you try to install an extension solely designed for Joomla! 1.0.x.

As we have seen, most of the installation problems are related to either insufficient permissions or inappropriate package files. You can avoid these easily by checking for an appropriate version of the package and ensuring that the permissions are correctly set for the directories.

For detailed information about setting file permissions, read this article at Wikipedia: http://en.wikipedia.org/wiki/File_system_permissions.


As a general rule, never set 777 (read-write access to owner, group, and others) for any file. Set 755 for folders and 644 for files. The configuration file should be protected first, therefore, once the configuration is done, set the file permission 444 for the configuration.php file.

[edit] SEF problems

Joomla! administrators often face some common errors after enabling Search Engine Friendly URLs. When you enable SEF from the Global Configuration screen, Joomla! generates search engine friendly URLs. However, if you choose to use mod_rewrite, the SEF may not work as expected. This may happen due to the fact that you have not renamed the file htaccess.txt to .htaccess. When you choose to use mod_rewrite, you also have to use the .htaccess file that comes with the Joomla! installation package. You may also face problems even after renaming the htaccess.txt to .htaccess. In this case you need to check the .htaccess file. First, make sure that RewriteEngine On is present in the file. Then, check for the line with RewriteBase. This line should reflect your Joomla! root directory. For example, if Joomla! is installed in the ./public_html/jflash/ directory, then the .htaccess file should contain RewriteBase ./public_html/jflash/.

SEF problems may occur due to a misconfigured .htaccess file. Sometimes you can solve SEF problems by commenting out the line with Options +FollowSymLinks in the .htaccess file. Before changing this file, you should have a clear understanding of its directives.

To configure SEF for Joomla! correctly and to solve related problems, refer to Joomla! 1.5 SEO published by Packt Publishing. Two other titles, Joomla! Web Security and Joomla! Accessibility, will also help you secure your site and optimize the use of the php.ini and .htaccess files.

[edit] Issues related to Flash

When using Joomla! with some Flash content, you may face problems which can be attributed to Flash. We often tend to find bugs in applications, which in fact originate from supporting technologies like Flash. This section illustrates these issues.

[edit] Flash 10 and Joomla! Flash Uploader

Many Flash-based web uploaders do not work with Flash 10. Joomla! 1.5.x has a Flash-based uploader. You can enable it by selecting Yes for the Enable Flash Uploader field in Site | Global Configuration | System. Once this Flash uploader is enabled, it should look as shown in the following screenshot:

First, the uploader lists the files selected for upload. You can select multiple files and upload them at the same time. When the Start Upload button is clicked, the files start uploading and a progress bar for each file is displayed. When the upload is finished, you will see the progress bars shown in the following screenshot:

This Flash uploader may not work as shown here when you are using Flash 10. A way around this is to either downgrade your Flash Player to version 9 or disable the Flash uploader by selecting No in the Enable Flash Uploader field in Site | Global Configuration | System.

For removing Flash Player 10, you should follow the instructions provided at http://kb2.adobe.com/cps/141/tn_14157.html. It gives you an opportunity to download an uninstaller for Flash Player 10. Once uninstalled using this uninstaller, download Flash Player 9 from http://www.adobe.com/support/flashplayer/downloads.html and install it. Do remember to restart your computer when prompted to do so.

[edit] Inserting a Flash object in the Joomla! header

When using Flash with Joomla!, you may need to embed some Flash code directly into templates. For example, you may want to show a Flash header in a template. The header Flash objects reside in the ./flash folder. In general, to embed a Flash object called header.swf, residing in the ./flash directory, we use the following code:

<param name="movie" value="flash/header.swf">

This locates the Flash object header.swf in the flash directory. However, this will not work in Joomla!. For Joomla!, you need to keep the Flash files in a subdirectory under the directory of the template in use and specify the path differently. The line of code will look like the following in Joomla!:

<object type="application/x-shockwave-flash" 
data="<?php echo $this->baseurl; ?>/templates/ 
<?php echo $this->template?>
/flash/header.swf" width="700" height="240">
<param name="wmode" value="transparent" />
<param name="movie" value="<?php echo $this->baseurl;
?> /templates/<?php echo $this->template?>/flash/header.swf" />
</object>

As you can see, the file path is generated dynamically and refers to the flash directory inside the template's folder.

[edit] Issues related to individual extensions

We have used several Joomla! extensions throughout the book. It is possible that you have had problems while configuring and using these extensions with Joomla!. Of course, not all extensions will give you trouble but some can. The following sections illustrate a few problems with some of the extensions discussed in this book. Of course there might be some other problems as well. For troubleshooting such problems their respective support forums will be of great help. The following sections will also give you addresses of the websites and support forums from where you can seek help.

[edit] Expose Flash Gallery

Installing Expose Flash Gallery may prevent the Joomla! frontend from showing anything. When you browse to the Joomla! frontend, it may show a blank page with absolutely nothing displayed not even an error message. To find out what's happening, you may try to amend error reporting in the Global Configuration | Server | Server Settings section, shown in the following screenshot:

Change the Error Reporting field from System Default to Maximum and save the configuration. Now when you browse to the Joomla! frontend, you will get the following error message:

Fatal error:

Cannot redeclare domxml_new_doc() in 
C:\wamp\www\jflash\components\com_expose\expose\manager\misc\domxml-php4-to-php5.php 
on line 41

You can see that the problem is with DOMXML. It usually happens with PHP5.x installations. One way is to turn the DOMXML extension off in the php.ini file. Open the php.ini file in a text editor and locate the following line:

extension=php_domxml.dll

Comment out the line by adding a semicolon (;) at the start of the line. Save the file, restart your web server, and browse to the Joomla! site. You will now be able to see the frontend.

For troubleshooting with the Expose Flash Gallery, refer to the forum at http://www.gotgtek.net/forum/. The forum is quiet supportive, and you will get many other possible solutions to such problems.

[edit] YOS amChart

YOS amChart may display error messages if you are using PHP5. With YOS amChart on PHP5.x, you may get the following error message:

Warning: Call-time pass-by-reference has been deprecated in 
C:\wamp\www\jflash\plugins\content\yos_amchart.php on line 15

To solve this open up the file referenced in this message and locate line 15, which contains the following line of code:

$arr_obj_chart = pluginChartHelper::getPattern($row, '/\{yos_amchart .*?\}/', $params);

Note the last word of the line, $params, which is causing the error. PHP4 supported passing values by reference. However, in PHP5, it becomes deprecated. You will get this error message only on a server running PHP5. One way to solve it is to delete the dollar sign ($) from $params and saving it. That will work fine without displaying the error message.

Another way of solving this is to edit the php.ini file. In the php.ini file, locate this line:

 allow_call_time_pass_reference = Off

This line in your php.ini file causes the error message. You need to turn it on by typing On in place of Off. The line will then look as follows:

 allow_call_time_pass_reference = On

In PHP5 and above versions, this is set to Off for keeping the code clean.

There may be some other problems with YOS amChart. Fortunately, there is a good support site for YOS amChart, and you can visit it at http://www.amcharts.com/forum/.

[edit] The Random Flash Module

In the Random Flash Module for Joomla! 1.5, you just need to configure the folder path for the Flash files, and the width and the height. These are set from the Module Parameters section in Module: [Edit]. Once these are set, you will notice that Flash objects are displayed properly in Microsoft Internet Explorer and other non-Netscape browsers, but not in Mozilla Firefox and some Netscape-based browsers.

This may happen due to the support for the <object> </object> and <embed> </embed> tags. The classid attribute mentioned in the <object> tag is ActiveX specific. That's why it doesn't get displayed even in some IE browsers.

To solve this problem, open the module file ./modules/mod_j15randomflash/ mod_j15randomflash.php in your text editor, and before the closing </object> tag, add the following line:

 <embed type="application/x-shockwave-flash" width="$width" height="$height" src="$flashbase/$top.swf">
 </embed>

Now the code for embedding Flash looks change to as follows:

 $content = <<<EOD
 <object classid=
  "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
   codebase="http://fpdownload.macromedia.com/pub/shockwave/ 
   cabs/flash/swflash.cab#version=7,0,0,0"
   width="$width" height="$height" id="g1">
  <param name="movie" value="$flashbase/$top.swf"/>
  <param name="loop" value="true"/>
  <param name="quality" value="$quality"/>
  <param name="bgcolor" value="$background"/>
  <embed type="application/x-shockwave-flash" 
  width="$width" height="$height" src="$flashbase/$top.swf"></embed>
 </object>
 EOD;

Having changed the code as highlighted, save the file and browse to the site's frontend. You will see Flash objects displayed both in IE as well as Firefox.

For more troubleshooting information on Joomla! 1.5 Random FlashModule, visit its support forum at http://www.dart-creations.com/forums.

[edit] Ozio Gallery

Ozio Gallery has lots of configuration options. If a specific configuration is not working, then recheck the configuration and read the instructions given inline once again. You can also get help from its support site at http://forum.joomla.it/index.php/board,73.0.html.

[edit] Dynamic Flash Gallery

Dynamic Flash Gallery displays the gallery using inline frames. For security, inline frames are discouraged, and some browsers do not show content in inline frames. This component will not work unless your browser supports inline frames.

[edit] JVideo!

The JVideo! component for Joomla! is well documented. Whenever a problem arises, first consult the documentation at http://jvideo.infinovision.com/support/user-guide and then, its support forum http://jvideo.infinovision.com/support/forum. Most of the problems submitted to the forum are answered, and you can expect a quick response.

The plugin for JVideo! may show some notices. To prevent these warnings, you need to edit the php.ini file, and add the following line:

error_reporting = E_ALL & ~E_NOTICE

This will show all errors except for warnings and coding standards.

Another problem with JVideo! is that you may get stuck with a message like the following: ,pre> Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Start tag expected, '<' not found in Entity, line: 1 in /home/suhreed/public_html/jflash/components/com_jvideo/ assets/lib/infin-lib.php on line 96 </pre>

Fatal error:

 Call to a member function getAttribute() on a non-object in 
/home/suhreed/public_html/jflash/components/ 
com_jvideo/assets/lib/infin-lib.php on line 99'''

This may happen when your server is using libxml2 2.7.2. The bug exists in libxml2 2.7.2, which strips off the braces when parsing XML files. To solve this problem you need to downgrade libxml2 2.7.2 to its earlier versions, say libxml2 2.6.x. Your hosting provider may help you in this regard.

[edit] J-AMFPHP

Configuring and running J-AMFPHP is easy when you know the tricks. After downloading and installing the J-AMFPHP package, you will have no clue about where to start from. It will not even tell you that it requires you to download the latest version of the AMFPHP package. Even downloading the AMFPHP package may cause a severe problem. You need to visit its website www.amfphp.org and download the AMFPHP package from SourceForge.net, using the link provided on the home page. The SourceForge.net page lists many versions of the AMFPHP package, where amfphp-1.9.beta.20080120.zip is the latest.

You may prefer to download the stable version rather than the beta, which is ampfphp 1.0.1. Doing this and extracting the files in the J-AMFPHP folders, as per the instructions given in Tutorial 7, will lead you to lots of trouble. First, with the default installation of J-AMFPHP, when you browse to the service browser, you get an error message like the one shown in the following screenshot:

To get rid of this message, you must download version 1.9 beta from http://sourceforge.net/projects/amfphp/files. After downloading the package, extract it on your computer, say in the e:\amfphp directory. Then, copy the e:\amfphp\services\amfphp folder to the plugins/j-amfphp/ folder of your Joomla! installation. Now point your browser to the amfphp/browser folder on your server, for example, http://localhost/flash/amfphp/browser/. This shows the available services.

If you download other versions, with the exception of version 1.9 beta, you may get error messages like the ones shown in the following screenshot:

Although beta versions are often not recommended for use, J-AMFPHP is built upon the AMFPHP 1.9 beta version. Therefore, you must use this version and copy the required files into the J-AMFPHP installation folders.

[edit] Source

The source of this content is Chapter 8: Troubleshooting Applications using Joomla with Flash of Joomla! 1.5x Customization: Make Your Site Adapt to Your Needs by Suhreed Sarkar (Packt Publishing, 2009).

Personal tools