Showing posts with label Joomla!. Show all posts
Showing posts with label Joomla!. Show all posts

Monday, May 7, 2018

"joomla.javascript.js" Uncaught TypeError: Cannot set property 'value' of undefined


Error message

joomla.javascript.js:323 Uncaught TypeError: Cannot set property 'value' of undefined
    at submitform (joomla.javascript.js:323)
    at submitbutton (index.php?option=com_xxx:337)
    at HTMLAnchorElement.onclick (VM2845 index.php:167)
submitform @ joomla.javascript.js:323
submitbutton @ index.php?option=com_feed:337
onclick @ VM2845 index.php:167
joomla.javascript.js:323 Uncaught TypeError: Cannot set property 'value' of undefined
    at submitform (joomla.javascript.js:323)
    at submitbutton (index.php?option=com_xxx:334)
    at HTMLAnchorElement.onclick (VM2847 index.php:159)

Solution

Add this line to the form named "adminForm" in your view file (default.php)
<input type="hidden" name="task" value="save" />
 For example :
<form action="index.php" method="post" name="adminForm">
    Do sth here
    <input type="hidden" name="task" value="save" />
    <?php echo JHTML::_('form.token'); ?>
</form>

Monday, December 29, 2014

[Joomla!][Resolved] joomla redirect feature doesn't not work after save.

When i click the "Save" button in a joomla administrator component, it's able to submit form but get <script>alert('');window.history.go(-1);</script> as response only. (redirection feature doesn’t work after save the data to database. )

These 4 lines is the related code:


According from the answer in stackflow, Joomla does not support something like that but Javascript does:

 window.history.back()

Change the code which echo JavaScript to html webpage to use joomla setRedirect() to make redirection. This is the original code:
if (!$db->store()) {
    echo "<script>alert('".$row->getError()."');window.history.go(-1);</script>\n";
    exit();
}
to
if (!$db->query()) {
    $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
    $this->setRedirect($url);

    exit();
}
Reference:
http://stackoverflow.com/questions/12948109/return-to-previous-page-in-joomla

Thursday, October 9, 2014

[Joomla!][Resolved] 500 View not found [name, type, prefix]

For my case, error was found when developing Joomla Adminstrator components, my Error message:
Let have a close look of the message first:
View class not found [class, file]: columnistViewadd, /usr/local/public_html_home22/beauty/cms/administrator/components/com_columnist/views/add/view.html.php

Text in green is the file location showing the which file caused the error message.



And then text in blue "View class not found" simply means Joomla can't the view with given class name.  "columnistViewadd"  is the class name Joomla wants looking for in files.
So you can open the files shown in message, and then view the class name in file, check that is that same as the class name that's Joomla looking for:


For my case:
Joomla is looking for the class name "columnistViewadd", but the class name in the file is "VideoViewAdd", so that for my case, i need edit the line7 from
class VideoViewAdd extends JView
to
class columnistViewadd extends JView

Run the page and again, and it's works in my case.

Tuesday, July 9, 2013

[Joomla!][Tutorial] Way to Add a shortcut icon to Joomla Admin control panel (with image)



This short article is for showing the how to add the icon to joomla 's  Admin control panel index  page and link to your component.
 
Firstly, let have a look about where the icon would be added:


And there is the way to add the icon:

1)      Visit this path and edit mod_quickicon.php.

Your_joomla_root\administrator\modules\mod_quickicon\mod_quickicon.php

 (change text in red to your joomla root)

2)      Look for the div tab with id name “cpanel” (<div id="cpanel"> … </div>) then copy one of these code.


Change text in red to your component folder name and text in blue to your icon button image path.


$link = 'index.php?option=com_benefit’;
quickiconButton( $link, 'icon-48-benefit-add.png', JText::_( 'New Post' ) );


And then the icon will be added:


Reference: