Displayed Image URL is incorrect. It should add "public/" in the url. How can I edit the url?
Instead of storing in public, I remove base directory as following:
'base_directory' => '',
'images_folder_name' => 'photos',
'files_folder_name' => 'files',
'shared_folder_name' => 'shares',
'thumb_folder_name' => 'thumbs',
And edit LfmHelpers.php under traits in line 113 as following:
$prefix = '/' . $prefix; And it works fine now.
If a UNISHARP then you need to have a look at this issue UNISHARP BUG as it suggest it is a bug.
The issue reporter find the solution by doing so
It worked after I removed the following from
vendor/unisharp/laravel-filemanager/src/views/script.blade.php
if (path.indexOf(ds) === 0) { path = path.substring(1); }
Hope it will solve yours.
My site is a Codeigniter with kcfinder and ckeditor, and my issue is when I try upload and load an image, this image upload correctly in an autocreated folder /assets/kcfinder/.thumbs/images/, but When I select the image from server, the URL is wrong and I can not see it. How can I set the correct path?
I thing that the problem is that you need to add the base url in your image path
base_url() . 'images/' . $img;
I have solved the problem.
In ../assets/kcfinder/config.php I changed:
'uploadURL' from "upload" to Absolute url and in
'uploadDir' from "" to "upload" and it worked!
Thanks anyway.
You can also use below code to set your KcFinder config settings:
<?php
/**
* KcFinder has a SESSION key name 'KCFINDER'
* You can use this as setup your dynamic config vales
* if you set uploadURL and uploadDir via SESSION, KcFinder ignore config.php
* to get these values and it start using SESSION values
*/
$_SESSION['KCFINDER'] = array(
'disabled' => false,
'uploadURL' => 'http://www.example.com/upload',
'uploadDir' => 'var/htdocs/www/upload'
);
More: See Link
I am just a newbie to the magento. I have installed magento on my localhost. After all the setup when I used the admin page to login I can't able to login in chrome browser even with my right username and password. But when I am trying to login in firefox there is no problem. So can some one really help me here to solve the problem?
I think there is the problem with session cookie with the chrome browser.
So just go through this directory
/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file
and comment out the line from 85 to 92 in magento (1.7.2 for my case). Like this
// session cookie params
/* $cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
*/
after that try to make login from your backend. Hopefully you can make login with chrome. This will definitely help you. If you are still facing the problem then just reply me.
try using 127.0.0.1 when you set up magento in localhost. I have also encounter same problem, that's the solution a have made and it works fine.
From System -> Configuration -> General -> Web, set Unsecure and Secure Base URL with IP Address. And try to login again.
GO to File at this location :- app\code\core\Mage\Core\Model\Session\Abstract\Varien.php
And commenting out the following (it's lines 85 to 102);
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()//,
//'domain' => $cookie->getConfigDomain(),
//'secure' => $cookie->isSecure(),
//'httponly' => $cookie->getHttponly()
);
//if (!$cookieParams['httponly']) {
// unset($cookieParams['httponly']);
// if (!$cookieParams['secure']) {
// unset($cookieParams['secure']);
// if (!$cookieParams['domain']) {
// unset($cookieParams['domain']);
// }
// }
//}
And use your credentials to logged in. Hope that should works for you!!!
Magento sees cookie_domain on core_config_data table when you try to login. If it is diffrent from your domain, you can not enter your admin panel, just refreshing the page, no error comes up.
Open core_config_data table from your database and search or filter the path column for web/cookie/cookie_domain and change it to null or your domain.
When it happens with me, the problems was because I make a directory move but the .HTACCESS files of main content was not moved to new path.
Check if your .htaccess file is in main content.
just apply the comment here...
file location : \app\code\core\Mage\Core\Model\Session\Abstract\Varien.php
/*
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
*/
login as admin with internet explorer or other broswer. flush all caches.. And you will be able to log in using chrome . You can login in without having to modify any code
If you are using Magento 1.9, the file must be slightly different:
/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()/*,
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()*/
);
/*if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}*/
It’s also important that you have a form key present, otherwise your form won’t get processed.
<?php echo $this->getBlockHtml('formkey'); ?>
This is my simple solution that helped me in the same situation. Try it for 60 seconds of your time.
In Google Chrome, in Developer Tools (right-click on any page element and select Inspect Element), go to the Resources -> Cookies tab. Delete the extra cookie for your original domain. Or set your base url domain to something else, or change the port.
As the accepted answer pointed out, the problem lies with chrome when accessing Magento on a localhost. Wrap the code in theapp/code/core/Mage/Core/Model/Session/Abstract/Varien.php with the following snippet, and the session parameter array will be only reset if you are on localhost (IP'127.0.0.1' or '::1').
// SNIPPET Part 1: add this before the original array definition
// -----------------------------------------------------------
if(in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) {
$cookieParams = array();
} else {
// here comes the original code, thats what you should
// look for but not touch
// -------------------------------------------------------
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
// SNIPPET Part 2: add the closing bracket
// ------------------------------------------
}
I have Magento ver. 1.14.2.1
changing varien.php did not solve my problem.
entering 127.0.0.1 instead of localhost in Dashboard configuration Web Base URL solved my problem.
I can still enter localhost in the url and it automatically redirects it to the ip format url.
For Magento 2
Instead of localhost on your WAMP please use http://127.0.0.1
{folder
path}\magento2\vendor\magento\zendframework1\library\Zend\Session.php
Go to & Comment as mentioned
public static function rememberUntil($seconds = 0)
{
if (self::$_unitTestEnabled) {
self::regenerateId();
return;
}
$cookieParams = session_get_cookie_params();
session_set_cookie_params(
$seconds,
//$cookieParams['path'],
//$cookieParams['domain'],
//$cookieParams['secure']
);
// normally "rememberMe()" represents a security context change, so should use new session id
self::regenerateId();
}
Having session/cookie problems with webkit browsers (e.g. Chrome) in Magento? Go to System -> Configuration -> Web -> Session Cookie Management and set “Use HTTP Only” to no. Have fun.
I bootstrap a Extbase plugin via a TypoScript object path (USER_INT):
lib.pagefiles = USER_INT
lib.pagefiles {
userFunc = tx_extbase_core_bootstrap->run
pluginName = Pi1
extensionName = Pagefiles
controller = PageFiles
action = list
view =< plugin.tx_pagefiles.view
settings =< plugin.tx_pagefiles.settings
}
The list action of this extension isnt cached anymore now (I tested it with a print of a timestamp in the controller).
When I load the action via a front-end plugin on the page the extension caching is working correctly.
My ext_localconf.php:
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'Pi1',
array(
'PageFiles' => 'list',
),
// non-cacheable actions
array(
)
);
?>
Does anyone understand whats going on here? How can I fix this problem?
The extension output is not cached, because you used a USER_INT object in your TypoScript configuration (USER_INT objects are never cached by definition).
Try using a USER object instead.
Anybody ever tried to change joomla 1.5 template in code? Don't know how to do it on current version. I just wanted to change the template after the user login.
So, i wrote code like this :
$mainframe->setTemplate('newtemplate');
But it doesn't works. WHen i see the joomla application.php, whoops, there is no setTemplate function there, but it used to be there before 1.5 (based on my search on the web).
Anyone know how to do it?
Update :
seems that we can set user state and just read that user state, then render. But I don't know where joomla render the template, since I put a code in library/joomla/application.php, insite render(), but it didn't get executed. This is what i did :
function render()
{
$params = array(
'template' => $this->getTemplate(),
'file' => 'index.php',
'directory' => JPATH_THEMES
);
// I added this code, where i set the user state $option.template somewhere else
$template = $mainframe->getUserState( "$option.template", 'FoxySales01VIP' );
if(!empty($template)){
$params['template'] = $template;
}
$document =& JFactory::getDocument();
$data = $document->render($this->getCfg('caching'), $params );
JResponse::setBody($data);
}
Never mind, i solved it.
Just change the code in core library (JDocument Class) to read the template from session, works fine.
Thanks