The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sat Sep 17, 2005 1:38 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
Hi,
Installation j100 went without a problem! Just when I try to use the Media Manager to upload an image (jpg,png,gif) I get the error "This file type is not supported" ... I can create folders though.
Otherwise, thanks for the timely release of J100!


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 2:04 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
Found the solution:
Replace in administrator/components/com_media/admin.media.php
uncomment/delete line 179-183:
                foreach( $allowable as $ext ) {
                        if ( strcasecmp( $format, $ext ) ) {
                                mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], 'This file type is not supported' );
                        }
                }
----and replace with:

                if (!in_array($format, $allowable)) {
                        mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], 'This file type is not supported' );
                }

Btw, would be nice to have the allowable media types changable via the Administrator.
G.


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 7:13 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sun Sep 11, 2005 1:34 am
Posts: 175
gunther wrote:
Btw, would be nice to have the allowable media types changable via the Administrator.


It would be nice to support formats such as .pdf and .swf  ;D


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 7:15 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Sep 11, 2005 10:42 pm
Posts: 47
http://forum.joomla.org/index.php/topic,6558.0.html

There is small problem in you code.. I like it better though!!!

Also PDF's and SWF's are supported.. Check the above link!


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 7:17 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
jonhurlock wrote:
gunther wrote:
Btw, would be nice to have the allowable media types changable via the Administrator.


It would be nice to support formats such as .pdf and .swf  ;D


You can actually add any format ... just add the extension to the $allowable array above line 179.


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 7:23 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
ustler wrote:
http://forum.joomla.org/index.php/topic,6558.0.html

There is small problem in you code.. I like it better though!!!

Also PDF's and SWF's are supported.. Check the above link!


Sure, I forgot the lower/upper case handling.
Replace in administrator/components/com_media/admin.media.php
Line 160: $format = substr( $file['name'], -3 );
with: $format = strtolower(substr( $file['name'], -3 ));
G.
BTW, this format is forcing us to use 3 digit extensions only! Greetings from DOS  ;)


Last edited by gunther on Sat Sep 17, 2005 7:26 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 8:14 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
One more for the road ...
In order to support file name extensions other than 3 (jpeg,gif,swl ...), you can use the following code:
Replace in administrator/components/com_media/admin.media.php
Line 160: $format = strtolower(substr( $file['name'], -3 ));
with the following:
                if (($dotpos = strrpos($file['name'] , '.')) === false) {
                        mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], 'This file type is not supported' );
                } else {
                        $format = strtolower(substr($file['name'], $dotpos+1));
                }
And don't forget to add the to the $allowable array, e.g.
                $allowable = array (
                        'xcf',
                        'odg',
                        'gif',
                        'jpg',
                        'jpeg',
                        'png',
                        'whatever'
etc.


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 9:40 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Aug 19, 2005 11:15 am
Posts: 16
mhh, i tried this, but i can't upload any kind of file.

"This file type is not supported for every file" (gif, png, jpg, zip, .... )  :(

_________________
"The king is dead, long lives the king!"
http://www.opensourcematters.org


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 9:45 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
ChaosNo1 wrote:
mhh, i tried this, but i can't upload any kind of file.

"This file type is not supported for every file" (gif, png, jpg, zip, .... )  :(


Which part did you try? It's working fine here. Maybe a missing piece or missed to comment out something
Send me line 165 - "if (!move_uploaded_file($file"


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 9:52 pm 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2756
Location: Marikina, Metro Manila, Philippines
Can you check if this has been reported on the 'Officia Bug Tracker':
http://developer.joomla.org/sf/tracker/ ... acker.bugs


If not please submit it with any potential fixes you have

_________________
Rey Gigataras - Joomlatools Team Member
http://www.joomlatools.eu <-- Joomla extensions that just work
http://path.to/rey.gigataras <-- About Me :)
Online Community Manager, Support Engineer, Web Developer, Event Manager, Sports Coach :D


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 10:05 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
stingrey wrote:
Can you check if this has been reported on the 'Officia Bug Tracker':
http://developer.joomla.org/sf/tracker/ ... acker.bugs


If not please submit it with any potential fixes you have

Yes, it is here: http://developer.joomla.org/sf/go/artf1037?nav=1 (Status Closed), but I have two additional modifications:

Here my code snippet:
Replacing line 160 - 184 with the following: (add your own extensions to the allowable array, extension are not anymore limited to 3 char with this code)
File: administrator/components/com_media/admin.media.php
--------------SNIP----------
Code:
              
if (($dotpos = strrpos($file['name'] , '.')) === false) {
                        mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], 'This file type is not supported' );
                } else {
                        $format = strtolower(substr($file['name'], $dotpos+1));
                }

                $allowable = array (
                        'xcf',
                        'odg',
                        'gif',
                        'jpg',
                        'jpeg',
                        'png',
                        'bmp',
                        'doc',
                        'xls',
                        'ppt',
                        'swf',
                        'pdf',
                        'odt',
                        'ods',
                        'zip',
                        'odp'
                );

                if (!in_array($format, $allowable)) {
                        mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], 'This file type is not su
pported' );
                }

--------------SNAP----------


Last edited by gunther on Tue Sep 20, 2005 4:17 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 10:27 pm 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2756
Location: Marikina, Metro Manila, Philippines
gunther wrote:
Yes, it is here: http://developer.joomla.org/sf/go/artf1037?nav=1 (Status Closed), but I have two additional modifications:

One of the Maintenance Team had already fixed the bug in SVN


Suggest for any further modifications you make a new bug report, as it essentially a new bug

_________________
Rey Gigataras - Joomlatools Team Member
http://www.joomlatools.eu <-- Joomla extensions that just work
http://path.to/rey.gigataras <-- About Me :)
Online Community Manager, Support Engineer, Web Developer, Event Manager, Sports Coach :D


Top
 Profile  
 
PostPosted: Sat Sep 17, 2005 10:31 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
stingrey wrote:
gunther wrote:
Yes, it is here: http://developer.joomla.org/sf/go/artf1037?nav=1 (Status Closed), but I have two additional modifications:

One of the Maintenance Team had already fixed the bug in SVN


Suggest for any further modifications you make a new bug report, as it essentially a new bug


Since it is not anymore a bug, rather an extension, no need to file a bug.

Thanks!


Top
 Profile  
 
PostPosted: Sun Sep 18, 2005 9:42 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Aug 19, 2005 11:15 am
Posts: 16
Quote:
--------------SNIP----------
                if (($dotpos = strrpos($file['name'] , '.')) === false) {
                        mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], 'This file type is not supported' );
                } else {
                        $format = strtolower(substr($file['name'], $dotpos+1));
                }

                $allowable = array (
                        'xcf',
                        'odg',
                        'gif',
                        'jpg',
                        'jpeg',
                        'png',
                        'bmp',
                        'doc',
                        'xls',
                        'ppt',
                        'swf',
                        'pdf',
                        'odt',
                        'ods',
                        'zip',
                        'odp'
                );

                if (!in_array($format, $allowable)) {
                        mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], 'This file type is not su
pported' );
                }
--------------SNAP----------


ok, now it works ;)

But there is one more Problem, if i try to delete a file:

Warning: unlink(/srv/www/htdocs/html/cms/images/stories/icons/test.gif): No such file or directory in /srv/www/htdocs/html/cms/administrator/components/com_media/admin.media.php on line 84

the file exitsts!

_________________
"The king is dead, long lives the king!"
http://www.opensourcematters.org


Top
 Profile  
 
PostPosted: Sun Sep 18, 2005 3:19 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
ChaosNo1 wrote:
ok, now it works ;)

But there is one more Problem, if i try to delete a file:

Warning: unlink(/srv/www/htdocs/html/cms/images/stories/icons/test.gif): No such file or directory in /srv/www/htdocs/html/cms/administrator/components/com_media/admin.media.php on line 84

the file exitsts!

Yes, there is another problem, but not related to the upload function. Anyhow, ustler posted it here: http://forum.joomla.org/index.php/topic,6558.0.html
Here in short:
Replace in administrator/components/com_media/admin.media.php
Line 83 : $del_image = $mosConfig_absolute_path."/images/stories".$listdir."/".$delfile;
With the following: $del_image = $mosConfig_absolute_path."/images/".$listdir."/".$delfile;

The 'stories' path was hardcoded in Mambo. Didn't like that too much as every upload was under stories.
This is much nicer!
G.


Top
 Profile  
 
PostPosted: Sun Sep 18, 2005 5:13 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Sep 18, 2005 3:57 pm
Posts: 17
Location: Maxwell, TX
I believe this is also part of the problem in the Contacts Manager in admin.contact.html.php... The path to ../images/stories seems to be hard coded there as well.

When one is in the Contact Manager editing a contact and the list of images is assigned, the only images that may be assigned to a contact are images in the images/stories folder.

I'm just not sure how to fix it since I don't know how to code in PHP yet.  (I've only been at this about 3 days, I can read the code, but I'm not up on all of the syntax... after more than 30 years of programming one thing I've learned is logic is logic is logic... only the syntax changes.  Time to learn a new language I guess!)

_________________
--
Ben E. Brady
"It's not what you look at that matters... it's what you see!" - Henry David Thoreau


Top
 Profile  
 
PostPosted: Sun Sep 18, 2005 5:54 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
benebrady wrote:
I believe this is also part of the problem in the Contacts Manager in admin.contact.html.php... The path to ../images/stories seems to be hard coded there as well.

When one is in the Contact Manager editing a contact and the list of images is assigned, the only images that may be assigned to a contact are images in the images/stories folder.

I'm just not sure how to fix it since I don't know how to code in PHP yet.  (I've only been at this about 3 days, I can read the code, but I'm not up on all of the syntax... after more than 30 years of programming one thing I've learned is logic is logic is logic... only the syntax changes.  Time to learn a new language I guess!)


Well, since you cannot select the path of an image in the 'Contact: Edit' part, you cannot use another directory than the default 'stories'. Would be nice to have a default directory named 'images/contacts/' for this purpose.

Searching through the complete Joomla! tree for 'stories' (grep -R stories *), I found about 98 lines of code with it.
G.


Top
 Profile  
 
PostPosted: Sun Sep 18, 2005 10:52 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Sep 18, 2005 3:57 pm
Posts: 17
Location: Maxwell, TX
gunther wrote:

Well, since you cannot select the path of an image in the 'Contact: Edit' part, you cannot use another directory than the default 'stories'. Would be nice to have a default directory named 'images/contacts/' for this purpose.

Searching through the complete Joomla! tree for 'stories' (grep -R stories *), I found about 98 lines of code with it.
G.


Having a images/contacts folder does make sense...  Hopefully someone will take this suggestion to heart. Thanks for your reply...

_________________
--
Ben E. Brady
"It's not what you look at that matters... it's what you see!" - Henry David Thoreau


Top
 Profile  
 
PostPosted: Mon Sep 19, 2005 2:18 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Sat Sep 03, 2005 10:54 am
Posts: 316
Location: San Francisco, CA
This is driving me crazy.  XP

The bug is filed as closed, fortunately it links to this thread. But,  still.

The bug should really not be closed unless there is some conformation that the patch works.

Can we move these discussions onto the bug tracker and not close bugs until they are fixed?

Sorry for the complaining, I just installed Joomla 1.0 and had to edit about 10 files to get it to install and it still is not working. (I cannot edit content (static content is editable though.))

Joomla 1.0 is a big step backwards in terms of finish. Really should have been a release candidate.

The typo's were shocking.


Top
 Profile  
 
PostPosted: Mon Sep 19, 2005 2:23 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Sep 18, 2005 3:57 pm
Posts: 17
Location: Maxwell, TX
The patch worked just fine for me... as well as the user activation patch that was posted here... http://forum.joomla.org/index.php/topic,6184.0.html

There is no such thing as perfect software... if you're looking for perfection, you're looking in the wrong place.

Thank God for Open Source and the generosity of countless numbers of people.  I'll be glad when I can become proficient enough to give back to the community.

_________________
--
Ben E. Brady
"It's not what you look at that matters... it's what you see!" - Henry David Thoreau


Top
 Profile  
 
PostPosted: Mon Sep 19, 2005 2:41 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Sat Sep 03, 2005 10:54 am
Posts: 316
Location: San Francisco, CA
I'm not looking for perfect software,

I was a little disappointed that one of my patches got dropped on the floor. (the whole reason for moving from email to a sourceforge, but still it is a little annoying when you have to get a site up.)

I will have to do a svn pull and generate patches. but I won't do that until Wednesday. (unless I am lucky.)


Top
 Profile  
 
PostPosted: Wed Sep 21, 2005 1:40 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Aug 28, 2005 11:20 pm
Posts: 29
Location: Toronto, Ontario, Canada
I'm not looking for perfect software either, and it's early in the game for Joomla, but it's a concern when things such as media file uploads that used to work don't anymore. A (corporate) client of mine who was playing around on a test version of Joomla I installed picked up on this right away, and it's making him edgy about upgrading after all the work we've done to get the Mambo version up and running. Free or not I think the objective is to get people to use Joomla, and problems like this first time out aren't going to help.

I'm glad to see we're going to get a bug fix release today. It'll be important for the developers to stay on top of these right now to show how Joomla is, in fact, an improvement over Mambo for practical as well as philosophical reasons.


Top
 Profile  
 
PostPosted: Wed Sep 21, 2005 6:39 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Sep 18, 2005 3:57 pm
Posts: 17
Location: Maxwell, TX
I've been looking at the code between Mambo 4.5.2.3 and Joomla! 1.0 and there have been some significant changes between the two (however, I have to point out that I've been comparing the 4.5.2.3 code without any bug fixes applied)

It's obvious that a project as large as this is going to have some bumps coming out of the gate... the thing that you have to keep in mind is that unlike monolihic software companies, the open source movement has a lot more going for it in terms of the longevity of the product.  We've already seen a significant number of developers who were loyal to Mambo defect to the Joomla camp (and I think for good reason) which will only serve to strengthen the product.  There may be some developers who remain committed to both products, but based upon what I have been seeing over the past couple of weeks, the tide is definitely turning toward Joomla!.

It's been less than a week since Joomla!'s release and they've already come up with a bug fix... that's a GOOD thing, as Martha would say...

_________________
--
Ben E. Brady
"It's not what you look at that matters... it's what you see!" - Henry David Thoreau


Top
 Profile  
 
PostPosted: Wed Sep 21, 2005 6:57 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
benebrady wrote:
I've been looking at the code between Mambo 4.5.2.3 and Joomla! 1.0 and there have been some significant changes between the two (however, I have to point out that I've been comparing the 4.5.2.3 code without any bug fixes applied)

It's obvious that a project as large as this is going to have some bumps coming out of the gate... the thing that you have to keep in mind is that unlike monolihic software companies, the open source movement has a lot more going for it in terms of the longevity of the product.  We've already seen a significant number of developers who were loyal to Mambo defect to the Joomla camp (and I think for good reason) which will only serve to strengthen the product.  There may be some developers who remain committed to both products, but based upon what I have been seeing over the past couple of weeks, the tide is definitely turning toward Joomla!.

It's been less than a week since Joomla!'s release and they've already come up with a bug fix... that's a GOOD thing, as Martha would say...

Yes, Joomla! 1.0.1 is out (http://developer.joomla.org/sf/go/projects.joomla/frs)! Unfortunately not with the suggested fix/enhancement for the media manager code.
http://forum.joomla.org/index.php/topic,6483.msg48690.html#msg48690
Anyhow, this part of J101 seems to be working fine!


Top
 Profile  
 
PostPosted: Thu Sep 22, 2005 12:09 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Sat Sep 03, 2005 10:54 am
Posts: 316
Location: San Francisco, CA
gunther wrote:

Since it is not anymore a bug, rather an extension, no need to file a bug.

Thanks!


Feature requests / enhancements are "bugs" as far as the sourceforge is concerned.

Any wanted/proposed change in the code should be filed as a bug so that people can keep track of it..


Top
 Profile  
 
PostPosted: Thu Sep 22, 2005 12:13 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Sep 18, 2005 3:57 pm
Posts: 17
Location: Maxwell, TX
micheas wrote:

Feature requests / enhancements are "bugs" as far as the sourceforge is concerned.

Any wanted/proposed change in the code should be filed as a bug so that people can keep track of it..


I would agree with this statement. If the code was only posted here in the forum and not in the forge, then it should not / can not be considered for inclusion into the code. It's the only fair way to do things.

_________________
--
Ben E. Brady
"It's not what you look at that matters... it's what you see!" - Henry David Thoreau


Top
 Profile  
 
PostPosted: Thu Sep 22, 2005 1:23 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
micheas wrote:
gunther wrote:

Since it is not anymore a bug, rather an extension, no need to file a bug.

Thanks!


Feature requests / enhancements are "bugs" as far as the sourceforge is concerned.

Any wanted/proposed change in the code should be filed as a bug so that people can keep track of it..


OK, I am convinced ... just didn't know exactly the procedure. Added it as a feature request!
http://developer.joomla.org/sf/go/artf1176?nav=1
Anyhow, this is just a tiny little thing, compared what the whole project is about! Kudos to the J-Team!


Top
 Profile  
 
PostPosted: Thu Sep 29, 2005 3:14 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Sep 02, 2005 8:34 pm
Posts: 25
Location: Honolulu
Is there a place to get a working copy of of administrator/components/com_media/admin.media.php file with the two fixes already done?

I've tried to patch it myself and am still getting errors. I can't delete files.  I can't move into the stories directory.

Also in the line containing $del_image = $mosConfig_absolute_path."/images/".$listdir."/".$delfile;
is there supposed to be a trailing slash after images?


Top
 Profile  
 
PostPosted: Thu Sep 29, 2005 3:38 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Sep 07, 2005 3:30 am
Posts: 31
gregwun wrote:
Is there a place to get a working copy of of administrator/components/com_media/admin.media.php file with the two fixes already done?

I've tried to patch it myself and am still getting errors. I can't delete files.  I can't move into the stories directory.

Also in the line containing $del_image = $mosConfig_absolute_path."/images/".$listdir."/".$delfile;
is there supposed to be a trailing slash after images?

The changes are supposed to be for Version 1.0.0. The updated 1.0.1 doesn't really need those fixes anymore.
In 1.0.1:  $del_image = $mosConfig_absolute_path . $base . $listdir .'/'. $delfile;


Top
 Profile  
 
PostPosted: Thu Sep 29, 2005 3:49 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Sep 02, 2005 8:34 pm
Posts: 25
Location: Honolulu
Thanks Gunther. I've downloaded the 1.0.1 patch files and uploaded them.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2  Next



Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group