The Joomla! Forum ™






Post new topic Reply to topic  [ 23 posts ] 
Author Message
PostPosted: Mon Jun 25, 2007 10:40 am 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Mar 24, 2006 4:58 pm
Posts: 92
Location: Derby, UK
When submitting a weblink in frontend form there is a JavaScript error:

From Firebug console:

Quote:
submitform is not defined
submitbutton("save")suggestlink (line 100)
onclick(click clientX=0, clientY=0)suggestlink (line 1)
[Break on this error] alert( "You must have a url." );


The relevant js as rendered by Joomla! is:

Code:
function submitbutton(pressbutton)
{
   var form = document.adminForm;
   if (pressbutton == 'cancel') {
      submitform( pressbutton );
      return;
   }

   // do field validation
   if (document.getElementById('jformtitle').value == ""){
      alert( "Weblink item must have a title" );
   } else if (document.getElementById('jformcatid').value < 1) {
      alert( "You must select a category." );
   } else if (document.getElementById('jformurl').value == ""){
      alert( "You must have a url." );
   } else {
      submitform( pressbutton );
   }
}


The submitform function doesn't appear to exist. Does it need to be included somewhere? The only js links are to mootools and caption.js.

The basic field validation does work otherwise.

Jon.

Joomla! 1.5 B2 Build 7777
Apache/2.2.4 (Win32) (WAMP server 1.7.2)
PHP 5.2.3
MySQL 5.0.41-community-nt
FF 2.0.0.4


Last edited by Jinx on Sun Sep 02, 2007 12:27 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Jul 14, 2007 3:42 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Tue Aug 23, 2005 4:10 pm
Posts: 103
If submitform is not defined, then /includes/js/joomla.javascript.js is not being included.  Just figured this one out myself!

_________________
My Joomla 1.5 Howtos


Top
 Profile  
 
PostPosted: Mon Jul 16, 2007 1:23 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Mon Dec 05, 2005 10:17 am
Posts: 1367
Location: New Orleans, LA, USA
Are you logged in when viewing the form?

The weblinks component doesn't allow you to submit new weblinks unless you are logged in.

We should probably add an extra check to not show the form unless the user is logged in.

_________________
Rob Schley - Open Source Matters
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions


Top
 Profile  
 
PostPosted: Mon Jul 16, 2007 8:44 am 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Mar 24, 2006 4:58 pm
Posts: 92
Location: Derby, UK
Hi Rob,

Good point - I'm not logged in.

Tried it logged in and recieved 404 with following error message:
Quote:
Call stack
# Function Location
1 JSite->dispatch() C:\wamp\www\ccd\index.php:75
2 JComponentHelper->renderComponent() C:\wamp\www\ccd\includes\application.php:121
3 require_once() C:\wamp\www\ccd\libraries\joomla\application\component\helper.php:167
4 JController->execute() C:\wamp\www\ccd\components\com_content\content.php:35
5 ContentController->display() C:\wamp\www\ccd\libraries\joomla\application\component\controller.php:240
6 JController->display() C:\wamp\www\ccd\components\com_content\controller.php:44
7 ContentViewArticle->display() C:\wamp\www\ccd\libraries\joomla\application\component\controller.php:314
8 JError->raiseError() C:\wamp\www\ccd\components\com_content\views\article\view.html.php:60
9 JError->raise() C:\wamp\www\ccd\libraries\joomla\utilities\error.php:166
10 JException->__construct() C:\wamp\www\ccd\libraries\joomla\utilities\error.php:131


The correct javscript include is there so that is better!

When I go back to home page (by typing url or clicking home page in the 404 message i then recieve this in the message area:

Quote:
notice

        * Language string failed to load: instantiate

message

        * Error Saving Weblink



An extra check would be a good idea - I suppose the better way is for the admin (who me?) to only allow this to be shown when logged in anyway. I had hoped it could be used by visitors and then link sent to an admin user for moderation.

Thanks

Jon.

WAMP5 Server 1.7.2 (XP Pro SP2)
Apache 2.2.4
PHP 5.2.3
MySQL 5.0.41
Firefox 2.0.0.4


Top
 Profile  
 
PostPosted: Mon Jul 16, 2007 3:58 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4778
Location: Toronto, Canada
The Article Submission Layout Description is:
Allow Users to submit an Article using this layout. Attention: This will only work for Authors and above!

The Weblink Submission Layout Description is:
Web Link Submission Layout Description
suggest change to:
Allow Users to submit a Web Link. Attention: This will only work for Authors and above!

Also, suggest change the article submission Layout Description to:
Allow Users to submit an Article. Attention: This will only work for Authors and above!
(i.e. get rid of the using this layout - it is awkward)

I suspect that it may be possible to allow weblink submission by public users when the new ACL system comes in 1.6 or beyond?

Ian


Top
 Profile  
 
PostPosted: Mon Jul 16, 2007 4:12 pm 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Mar 24, 2006 4:58 pm
Posts: 92
Location: Derby, UK
Good comment Ian - This idea did occur to me. An updated description would be the most straightforward way. Added to this good documentation and the rest. The entirely fool proof solution (for the time being) would be to only allow the access levels of registered or special when adding the component as a menu item - can this be done given that it is determined in the menu manager? forgive me my component programing knowledge is pretty basic at the mo.

It isn't a show stopper that public users can't submit links but would be nice - a contact form will do the same job - and that will force moderation.

Regards,

Jon.

Forgot to say in last post: Currently testing with build 7992.


Top
 Profile  
 
PostPosted: Mon Jul 16, 2007 4:15 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4778
Location: Toronto, Canada
Looking at the way the system works there is no provision for this, and so I don't think you could disable this in the menu manager with a chunk of extra code which would likely introduce other problems into the system.  I would call this a feature request and put the onus on system administrators to do their job, though at some point in a future release it would be better if this was not allowed.

Ian


Top
 Profile  
 
PostPosted: Mon Jul 16, 2007 4:50 pm 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Mar 24, 2006 4:58 pm
Posts: 92
Location: Derby, UK
Agreed. in that case a revised layout description is in order. Have put together one here:

Patch for components\com_weblinks\views\weblink\tmpl\form.xml:

Code:
<?xml version="1.0" encoding="utf-8"?>
<metadata>
   <layout title="WEBLINK SUBMISSION LAYOUT">
      <message>
         <![CDATA[WEBLINK SUBMISSION LAYOUT DESC]]>
      </message>
   </layout>
   <state>
      <name>WEBLINK SUBMISSION LAYOUT</name>
      <description>Allow Users to submit a Web Link. Note: This feature will only work for Users who are logged in with Author permissions and above! It is recommended that the Access Level of this menu item is set to Registered or Special.</description>
      <params>
      </params>
   </state>
</metadata>


If this is the wrong way to do this please forgive me - really trying to get to grips with MVC system and I think that this xml file overides some other code I haven't as yet found! If there is a neater way to do it let me know!

Agreed on feature request - not an urgent one but a nice to have!

Thanks,

J.


Top
 Profile  
 
PostPosted: Mon Jul 16, 2007 5:06 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4778
Location: Toronto, Canada
No problem...

This should actually get changed in the languages file.

File to change is:
administrator/language/en-GB/en-GB.com_weblinks.ini.

Ian


Top
 Profile  
 
PostPosted: Mon Jul 16, 2007 6:00 pm 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Mar 24, 2006 4:58 pm
Posts: 92
Location: Derby, UK
um i knew something wasn't quite right about that. I adapted the original desc in my last attempt and added it into the attached file.

learning all the time...  8)

J.


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: Mon Jul 16, 2007 10:30 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar
Offline

Joined: Wed Aug 17, 2005 10:27 pm
Posts: 9545
Location: Kent, England
Hi
Been working on these last few days and will be updating shortly.

Andy

_________________
Andy Wallace - Author of The Joomla! 1.5 Installation Manual http://joomlacode.org/gf/download/docmanfileversion/664/17471/1.5_Installation_Manual_version_0.5.pdf 606,000 downloads and counting!!


Top
 Profile  
 
PostPosted: Tue Aug 21, 2007 8:28 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Fri Sep 16, 2005 8:41 pm
Posts: 3745
Location: NRW - Germany
I inserted a fix to check if the user is logged in (copied from the article submit form) in revision 8498

_________________
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.


Top
 Profile  
 
PostPosted: Wed Aug 22, 2007 7:20 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6566
Can the fix be confirmed so I can close this one down ?

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
 Profile  
 
PostPosted: Wed Aug 22, 2007 4:56 pm 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Mar 24, 2006 4:58 pm
Posts: 92
Location: Derby, UK
I can confirm that this now works as follows:

- Add weblink is not permitted unless logged in to front end - directs to a 403 if not logged in.
- In back end language fix is a better description for admins.

As before responsibility must lie therefore with admins to only publish this menu item when set to registered - could this be made a default I wonder?

Will mark as solved.

Jon.


Top
 Profile  
 
PostPosted: Wed Aug 22, 2007 5:32 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar
Offline

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7687
Location: New York
You know, there is another problem with that weblink form which is even logged in as superadmin when you click submit you get a 500 error message, though the link itself is saved.

_________________
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Top
 Profile  
 
PostPosted: Wed Aug 22, 2007 7:07 pm 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Mar 24, 2006 4:58 pm
Posts: 92
Location: Derby, UK
How embarrasing  :-[ I missed that - I was testing with SEFs turned ON!!

So, with SEF turned on (both SEF and mod_rewrite option in global config) the form works and returns you to home with a message.

With SEF off (default install) the form does post and an entry is made including sending a mail to admin but the server returns 500:

WAMP 1.7.2:
Database Version: 5.0.41-community-nt
PHP Version: 5.2.3
Web Server: Apache/2.2.4 (Win32) PHP/5.2.3
Web Server to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.0 Production/Stable [ Mapya ] 21-July-2007 15:00 GMT (BUILD SVN 8502)
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

Here is log extract:

Code:
192.168.0.12 - - [22/Aug/2007:20:05:38 +0100] "POST /default/index.php?Itemid=53&option=com_weblinks HTTP/1.1" 301 -
192.168.0.12 - - [22/Aug/2007:20:05:38 +0100] "GET /default/index.php?option=com_weblinks&view=weblink&Itemid=53 HTTP/1.1" 500 1043
192.168.0.12 - - [22/Aug/2007:20:06:09 +0100] "GET / HTTP/1.1" 200 5579


Sorry for false +ve.

J.


Top
 Profile  
 
PostPosted: Fri Aug 24, 2007 11:37 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 10:41 am
Posts: 15729
Confirming the 500 error submitting a weblink as super admin, see debug info:

Quote:
500 - An error has occured

An error has occurred while processing your request.

Please try one of the following pages:

    * Home Page

If difficulties persist, please contact the System Administrator of this site.

Layout "default" not found

Call stack
# Function Location
1 JSite->dispatch() C:\wamp\www\joomla_dev-15\index.php:75
2 JComponentHelper->renderComponent() C:\wamp\www\joomla_dev-15\includes\application.php:126
3 require_once() C:\wamp\www\joomla_dev-15\libraries\joomla\application\component\helper.php:157
4 JController->execute() C:\wamp\www\joomla_dev-15\components\com_weblinks\weblinks.php:36
5 WeblinksController->display() C:\wamp\www\joomla_dev-15\libraries\joomla\application\component\controller.php:240
6 JController->display() C:\wamp\www\joomla_dev-15\components\com_weblinks\controller.php:44
7 WeblinksViewWeblink->display() C:\wamp\www\joomla_dev-15\libraries\joomla\application\component\controller.php:314
8 JView->display() C:\wamp\www\joomla_dev-15\components\com_weblinks\views\weblink\view.html.php:47
9 JView->loadTemplate() C:\wamp\www\joomla_dev-15\libraries\joomla\application\component\view.php:175
10 JError->raiseError() C:\wamp\www\joomla_dev-15\libraries\joomla\application\component\view.php:643
11 JError->raise() C:\wamp\www\joomla_dev-15\libraries\joomla\utilities\error.php:166
12 JException->__construct() C:\wamp\www\joomla_dev-15\libraries\joomla\utilities\error.php:131

_________________
Regards Robin

http://www.linkedin.com/in/robinmuilwijk - http://twitter.com/i_robin


Top
 Profile  
 
PostPosted: Fri Aug 31, 2007 3:42 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Aug 15, 2007 9:38 pm
Posts: 20
Was there any new development for this problem?  Just noticed myself that I get 500 after submit as any registered user. 

Image


Top
 Profile  
 
PostPosted: Fri Aug 31, 2007 4:29 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Aug 15, 2007 9:38 pm
Posts: 20
And with Debug on....

Could this be a problem with 1.5 and an older template?  I am using js_naturale in legacy mode.

Image


Top
 Profile  
 
PostPosted: Sun Sep 02, 2007 11:31 am 
User avatar
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Sun Sep 02, 2007 11:27 am
Posts: 4
Location: Atlanta, GA
I have a fresh install of Joomla 1.5 RC and I have the same problem. Any idea?


Top
 Profile  
 
PostPosted: Sun Sep 02, 2007 12:26 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar
Offline

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7687
Location: New York
Is it saving? If so what category?

_________________
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Top
 Profile  
 
PostPosted: Sun Sep 02, 2007 12:27 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6566
Fixed on SVN, the whole weblink and article submission process needs a decent review though it has a few flow problems. I have marked this as a to do and will have a look at it in the coming weeks.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
 Profile  
 
PostPosted: Sun Sep 02, 2007 1:19 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Fri Sep 16, 2005 8:41 pm
Posts: 3745
Location: NRW - Germany
Fixed an issue in com_weblinks submission

_________________
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ] 



Who is online

Users browsing this forum: No registered users and 1 guest


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