I'm working with one array that have 55 elements inside and each one are another array with 17 elements each one.
When I show the array on the screen, nothing wrong happens but when I take a look in the page source, I have 55 x 17 "Severity: Notice" errors with the message "Undefined index".
Does someone know what can be wrong?
If the index really doesn't exist, I couldn't see the array on the screen.
I tested using if ( isset( ) ) { ... }, but still the same.
Codeigniter version: 1.7.2
Browsers tested: firefox, chrome, ie and safari.
I usually get this errors when I'm trying to echo something that is not defined. It's not an PHP error, only a notice. This is produced by the function error_reporting(); on the main index.php.
If you open this index.php file, you will see:
/*
|---------------------------------------------------------------
| PHP ERROR REPORTING LEVEL
|---------------------------------------------------------------
|
| By default CI runs with error reporting set to ALL. For security
| reasons you are encouraged to change this when your site goes live.
| For more info visit: http://www.php.net/error_reporting
|
*/
error_reporting(E_ALL);
You've two options:
Don't print a variable that is not defined.
Change the error_reporting(); with a non-notice prints. Like: error_reporting(E_ALL & ~E_NOTICE);.
Wish this helps you!
This has nothing to do with CI or your browser, it is a classic PHP notice.
Related
$funcNum = $_GET['CKEditorFuncNum'] ; is not returning the number.
I tried creating the upload.php for ckeditor uploadimage plugin according to
https://stackoverflow.com/a/44553006/8719001 (sorry can't add comments yet)
which includes echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($funcNum, '$url', '$message');</script>";
However when I drop images it doesn't work and in the console I get the Response Text which doesn't show any funcNumber:
"<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction(, 'https://example.com/upload/test.jpg', '');</script>"
I think this might be part of filebrowser plugin?
Which I have enabled and also declared $settings['filebrowserUploadUrl'] =
Try to setup config.js insert config.filebrowserUploadMethod = 'form';,if you got CKEditor additional arguments empty,(CKEditor,langCode,CKEditorFuncNum). There are some errors occur,
Incorrect server response. and [CKEDITOR] Error code: filetools-response-error..
please refer,https://github.com/ckeditor/ckeditor-dev/issues/1894
This is the version problem.
I tried 2 hours and couldn't get the parameter CKEditorFuncNum with java like you.
After I changed my 4.9.1 version to 4.7.3, it worked.
I'm developing an extension for Joomla!; at the moment I'm trying to make it 3.0 compatible - as with 3.0 the logging changed a little (*). Building on the answer from this related question, my current code looks like this:
JLog::addLogger(array(
'text_file' => 'plg_system_myplg.log.php'
));
JLog::add('blah blah log msg');
The problem is that the log also goes to the messages which are shown to the user - this I want to prevent, I want the log msg only to go to the log file. I think it has to do with the "category" that JLog::add takes as a 3rd (optional) parameter, but I have no idea what to pass there?
Can anybody tell me how to hide the messages / or tell me if I'm on the right way with the categories and what value I should use?
Thanks!
(*) It actually changed already with 1.7 as far as I gathered so far, but the old method of calling addEntry on the return of JLog::getInstance(...) seems to have been removed from 2.5 to 3.0.
Edit: Think I found a way now; using:
JLog::addLogger(array(
'text_file' => 'plg_system_myplg.log.php',
JLog::ALL,
'myplg'
));
JLog::add('blah blah log msg', JLog::INFO, 'myplg');
all my log entries go only into my log file (and not to the messages shown to the user). However, I also get a few deprecation warnings - one about my code, but also some unrelated ones:
WARNING deprecated JAccess::getActions is deprecated. Use JAccess::getActionsFromFile or JAcces::getActionsFromData instead.
WARNING deprecated JSubMenuHelper::getEntries() is deprecated. Use JHtmlSidebar::getEntries() instead.
WARNING deprecated JSubMenuHelper::getFilters() is deprecated. Use JHtmlSidebar::getFilters() instead.
WARNING deprecated JSubMenuHelper::getAction() is deprecated. Use JHtmlSidebar::getAction() instead.
Not sure what to make of those - why do they appear in my log file, shouldn't they go to the default error.log file instead of my file ?
This is what I am using, works for Joomla 1.5 - 3.2:
if(version_compare(JVERSION,'1.7.0','ge')) {
jimport('joomla.log.log'); // Include the log library (J1.7+)
$priorities = JLog::ALL ^ JLog::WARNING; // exclude warning (because of deprecated)
// In J3.0 we need to ensure that log messages only go to our file, thus use the categories (already supported in J2.5)
if(version_compare(JVERSION,'2.5.0','ge')) {
$logCategory = 'com_mycomponent';
JLog::addLogger(array('text_file' => $logFileName), $priorities, $logCategory);
JLog::add($msg, JLog::INFO, $logCategory);
}else{
JLog::addLogger(array('text_file' => $logFileName), $priorities);
JLog::add($msg, JLog::INFO);
}
} else {
// Joomla! 1.6 and 1.5
jimport('joomla.error.log'); // Include the log library
$log = &JLog::getInstance($logFileName);
$log->addEntry(array('comment' => $msg, 'level' => 'INFO'));
}
This shows the trick for gettring of the deprecated messages.
And yes, you have to include a category for your messages to ensure they are not showing up as system messages.
Use
new JException('Something happened');
This will only add it to debug log but will not show anything.
It seems, that Joomla 3.0 has no default logger enabled. The same in Joomla 3.0.3. Nothing turns logging on by default - even Debug mode.
Finally I think I have solved my issue with unrelated log entries showing up.
A close look at the API documentation of the addLogger function revealed that the third parameter, $categories, is supposed to be an array of categories for which this log will be used.
This is in contradiction to the version of http://docs.joomla.org/Using_JLog that is current at the time of this writing, where a single category is given instead of an array.
Changing my call to addLogger to use an array, like this:
JLog::addLogger(array(
'text_file' => 'plg_system_myplg.log.php',
JLog::ALL,
array('myplg')
));
And keeping my fingers crossed that this will fix the issue!
Edit: unfortunately even this still doesn't solve my issue - still got unrelated entries :(.
I found the answer.. hope this script make you understand.. I already built as function . this code work on joomla 3. hope work in joomla 2
<?php
function logWrite($level, $values, $file='%s.php',$path='',$showOnTop=0,
$option='',$component=''){
/****
jlog Joomla 3.4
created by:gundambison (2015.04.26).
THX: hbit#stackoverflow
****/
jimport('joomla.log.log');
$level=strtoupper($level);
//You can change this com_name
$component= $component==''? 'com_gundambison': $component;
$date= date("Ymd");
$filename= sprintf($file, $date);
$format= $option=='' ?"{TIME}\t{CLIENTIP}\t{CATEGORY}\t{MESSAGE}": $option;
// create options and text
$txt = is_array($values)? json_encode($values): $values;
$options = array('text_file' => $filename,'text_entry_format'=>$format );
$options['text_file_path']=$path==''?'logs': $path;
JLog::addLogger ($options);
/*
if you want the error to show in your page. just see the different
*/
if($showOnTop==1){
JLog::add("$txt");
}
else{
JLog::add("$level\t$txt",$level,$component);
}
}
I have the following problem:
I use Joomla 3.0.1 and my own developed Template(with bootstrap). When I turn the normal Joomla caching to on, my site has output errors. These errors are regarding to the modules.php from my template, because I use a static variable(array) to save all loaded module positions and the calulated or preseted spans for bootstrap in an 2 dimensional array. Like this:
top ->2,4,6
left ->3,3,3,3
right ->4,4,4
bottom ->1,2,3,4,2
header ->12
footer ->6,6
Without caching it works perfect, but when i turn it on, i have following errors:
Notice: Undefined index: logo in
/root/templates/jooag_workframe30/html/modules.php on line 82
Notice: Undefined index: mainmenu in
/root/templates/jooag_workframe30/html/modules.php on line 72
I know what this means and where to look, but i have no solution to fix this.
The modules.php code is here:
http://pastebin.com/s4tjXcKR
The entire template is here:
http://www.mediafire.com/?qrkbatdcbs4iq2v
If a position doesn't contain any modules (ie $modCount = 0) the $spanMatrix array won't have its key, so you should be checking whether it exists before trying to access it
I suggest you wrap lines 72-75 AND line 82 of your modules.php in the following statement:
if( isset( $spanMatrix[$modPosition] ))
{
.....
}
Let me know if it works
I have written the header.tpl and login.php file in smarty. i want to show the logout text if user is logged in. otherwise it should show login if user is not logged in.below is the code of login.php
if(isset($_REQUEST['submit']))
{
$name=$_REQUEST['name'];
$pass=$_REQUEST['pass'];
$rs=mysql_query("select * from form where name='$name'");
$fetchdata=mysql_fetch_array($rs);
if($rs)
{
$name=$fetchdata['name']
$_SESSION['name']=$name;
$name1=$_SESSION['name'];
//$smarty->assign('name',$_SESSION['name']);
$smarty->assign('name1',$name1);
$smarty->display("about.tpl");
}
else
{
$smarty->display("login.tpl");
}
}
below is the header.tpl code
{if $name1!= ''}: Logout{else}login{/if}
it is showing error
Parse error: syntax error, unexpected T_VARIABLE in D:\xampp\htdocs\smarty\login.php on line 29
I found a bunch of weird things.
You should escape the name and pass before inserting into sql query. see http://www.php.net/manual/en/function.mysql-real-escape-string.php for more details.
The php documentation recommend that you should use the MySQLi extension
I can't see a authentication..I mean you don't use the give password. Is this correct?
I think mysql_query isn't falsey even when the result is empty. You can solve this with if($fetchdata=mysql_fetch_array($rs)){... instead of if($rs)
I'm not sure if this would throw an exception but i would write {if {$name1|default:""}!= ''}: Logout{else}login{/if} instead of {if $name1!= ''}: Logout{else}login{/if}
This is an old post, but I ran into a similar issue just a couple minutes ago.
I was getting an parse error for the variable: $_smarty_t
I tried different things to make there error go away, but there was nothing obvious. I confirmed that caching was turned off, but the issue persisted, even after deleting the individual cached file.
Eventually I deleted the entire contents of that directory and refreshed, and the error finally resolved.
This issue occurred with Smarty v3.1.27, as loaded through Composer, smarty/smarty.
I saved my column permutation info into a table. This information can be reloaded in beforeRequest event:
mynewperm = {....};
myGrid.jqGrid("remapColumns", mynewperm, true);
The columns are reordered correctly. However I lost the header icon. Now if I click any column header, I can not see
the sort icon anymore, then can not sort any column. How can I get it back?
Thank you,
yh
if you are able to change the code, you could test for an undefined of a.grid.headers[a.p.lastsort].
In the source file it could look like this:
// old
var previousSelectedTh = ts.grid.headers[ts.p.lastsort].el
// new:
var previousSelectedTh = ts.grid.headers[ts.p.lastsort] ? ts.grid.headers[ts.p.lastsort].el : null
Indeed if you look at the jquery.jqGrid.src.js source, the line is:
var previousSelectedTh = ts.grid.headers[ts.p.lastsort].el, newSelectedTh = ts.grid.headers[idxcol].el;
Line #1982 in my version. I fixed it by modifying the file and added this just before that line:
if (ts.p.lastsort < 0) // johnl.
ts.p.lastsort = 0;
The problem was that ts.p.lastsort was -1.
I've just managed to fix this issue myself but not using the methods described above. I was receiving the following error message when trying to sort columns in a jqgrid:
TypeError: a.grid.headers[a.p.lastsort] is undefined js/jqgrid/jquery.jqGrid.min.js?1.4:86
I should note that it was Firebug that produced this error message. Our company develops web applications for Chrome but Chrome's Javascript console produced a very uninformative error message:
Uncaught TypeError: Cannot read property 'el' of undefined
After stripping out all but the jqGrid declaration on the page causing the issue, it transpired that removing the "multiSelect" option declaration for the jqGrid solved the issue. Apparently, declaring this option causes an additional hidden column to be added into the grid rendered which enables users to select multiple grid rows at a time. I'm not exactly sure why this caused an issue but after consultation with the programming director here our best guess is that there is a for loop somewhere in the jqGrid library code which is called when column sorting is applied and the loop is not taking into account this extra column which results in it not being defined.
Strange answer to a strange issue but hopefully this will help somebody out in future and save them around 3 hours of debugging!
I've the same issue :
It append to me since i apply the "remapColumns" method in the "loadComplete" event (i get back user column configuration from a cookie).
So when I try to sort a column nothing happen. I got this error in firebug :
a.grid.headers[a.p.lastsort] is undefined -> jquery.jqGrid.min.js (line 93)
maybe it will be helpful to find what the problem is
Thank you