How to return CKEditorFuncNum? - ckeditor

$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.

Related

Updating to Wakanda 11: "[Backend] Cannot read property 'replace' of undefined in undefined on line undefined"

I am looking to move my Wakanda application, created in Enterprise Studio v10, to Enterprise Studio/Server v11. I can start the solution successfully, but when I try to view my webapp in browsers, Wakanda Studio logs the error:
[Backend] Cannot read property 'replace' of undefined in undefined on line undefined
and the browser shows just a white page with some console errors (below).
Edit: commenting out all occurrences of .replace() does not solve the problem. I do not believe it is possible that this issue is the result of .replace() statements that I've written.
I do use string.replace() with regular expressions in a few places. The code works perfectly fine in v10 and am confused about what could be wrong.
Here is an example of how I am using replace() in the code:
var tempString = "";
tempString = tempEntity.sourceProjects;
tempString = tempString.replace(/,/g, " ");
tempString = tempString.replace(/other_/, "Other: ");
The code was more streamlined before- I broke it out into pieces in an attempt to get rid of the error, but no dice.
Browser with console errors:
What I see when I click on "Loader.js: 2073"
1) Quit Wakanda
2) Delete the old index.package.json file inside of index.waPage
3) Restart Wakanda and let Wakanda v11 regenerate it
You have the error : "Cannot read property 'replace' of undefined" because in line 2, tempEntity is an empty string and you write tempEntity.sourceProjects.
The value of tempEntity.sourceProjects is "undefined", so when you try to use replace in line 3 you get this error.
Issam

Ajax request POST returns 403 error, GET returns 200 ok on same url

I'm trying to set up a prestashop webshop and I bought a theme to customize it. Instalation works great, but when reaching the live edit module of the theme I ran into a problem: after customizing the layout I tried to save my modifications, but it returns with 403 error. I've tried to debug it, I've contacted my hosting, I've contacted the developer of the theme, but noone can help me. In the error logs doesn't appear anything regarding this issue. The developer says it is tested on multiple hosts, and it works great. My host says they can't do anything if there is no error message in the logs.
I've managed to circle down the issue a little bit. There is a larger sized parameter(it contains all new configurations) which if I disable to be sent, then I get the following error: "Your hosting provider has set a non-standard or too little value of parameter LimitRequestLine in httpd.conf. Set the default setting value of parameter LimitRequestLine in httpd.conf, please." This error I receive on post and get aswell.
This parameter can be the source of my problem if the http call is through ajax post? Or there is more this issue?
I'm trying to solve this issue for 3 months now, I've spoken to the hosting firm, I've spoken to the developer of the them, I've searched a lot of forums but found no answer to this. I'm desperate to get any help on this matter.
It looks like I solved the issue with the following codes:
/public_html/modules/ixtengine/js/cpanel/cpanel.min.js
... ,$.ajax({type:"POST",url:cpfuncurl+previewfun,data:{ ...
replaced by
... ,$.ajax({type:"PUT",url:cpfuncurl+previewfun,data:{ ...
and
... ,$.ajax({type:"POST",url:cpfuncurl+savefun,data:{ ...
replaced by
... ,$.ajax({type:"PUT",url:cpfuncurl+savefun,data:{ ...
/public_html/modules/ixtengine/cpanel/functions/upload.savepf.php and /public_html/modules/ixtengine/cpanel/functions/upload.previewwid.php
...
$theme = Tools::getValue('theme');
$conf = Tools::getValue('conf');
$skin = Tools::getValue('skin');
$skinid = Tools::getValue('skinid');
$token = Tools::getValue('token');
...
replaced by
...
$put_vars=array();
if($_SERVER['REQUEST_METHOD'] == 'PUT')
{
parse_str(file_get_contents("php://input"),$put_vars);
$theme = $put_vars['theme'];
$conf = $put_vars['conf'];
$skin = $put_vars['skin'];
$skinid = $put_vars['skinid'];
$token = $put_vars['token'];
}
else
{
$theme = Tools::getValue('theme');
$conf = Tools::getValue('conf');
$skin = Tools::getValue('skin');
$skinid = Tools::getValue('skinid');
$token = Tools::getValue('token');
}
...
This solution is particulary for the ixtengine module for some hosts where POST returns 403 error so I can't be sure if this method will work for someone else running into this problem, but it works for me.

Joomla >1.7 hide log messages from browser

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);
}
}

when using remapColumns in different event, sort icon doesn't show when clicking a header

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

codeigniter image reader prob

Hi im making a image gallery in useing the following tutorial at
http://superdit.com/2010/06/27/basic-image-gallery-with-codeigniter/
i keep getting this error
wrong parameter count for strstr()
google'd and tried this and found i needed to remove a third parameter.
I removed the third parameter from line38 $ext = strrev(strstr(strrev($file), ".", TRUE));
now all errors are gone but the image uploading will not work any ideas why this is now failing ?????
Thanks Alan
hi I think that tutorial using PHP 5.3 so the strstr function has the third parameter

Resources