• Home
  • Support
  • Forum
  • Cobalt 8
  • Import error "Invalid argument supplied for foreach() in *my_path*/public_html/components/com_cobalt/fields/url/url.php"

techutopia
Total posts: 202
23 Aug 2014 21:46

Hi all,

I'm getting the following errors when running an import from CSV file.

The strange thing is that I am not trying to import any url data (it's not availiable to select anyways), but I do note that I have 4 url fields in my type.

Warning: Invalid argument supplied for foreach() in my_path/public_html/components/com_cobalt/fields/url/url.php on line 93 Warning: Invalid argument supplied for foreach() in my_path/public_html/components/com_cobalt/fields/url/url.php on line 135 Warning: Invalid argument supplied for foreach() in my_path/public_html/components/com_cobalt/fields/url/url.php on line 93 Warning: Invalid argument supplied for foreach() in my_path/public_html/components/com_cobalt/fields/url/url.php on line 135 Warning: Invalid argument supplied for foreach() in my_path/public_html/components/com_cobalt/fields/url/url.php on line 93 Warning: Invalid argument supplied for foreach() in my_path/public_html/components/com_cobalt/fields/url/url.php on line 135 Warning: Invalid argument supplied for foreach() in my_path/public_html/components/com_cobalt/fields/url/url.php on line 93 Warning: Invalid argument supplied for foreach() in my_path/public_html/components/com_cobalt/fields/url/url.php on line 135 Warning: strpos() expects parameter 1 to be string, object given in my_path/public_html/libraries/framework/Joomla/Registry/Registry.php on line 170 Catchable fatal error: Object of class stdClass could not be converted to string in my_path/public_html/libraries/framework/Joomla/Registry/Registry.php on line 172

Has anyone else seen this or can give me any pointers please?

Thanks,

Dale.

Last Modified: 06 Nov 2014


techutopia
Total posts: 202
23 Aug 2014 21:57

For a bit of further information ...

I am only trying to import one record at the moment.

The resulting record is added, but the only data I can see and the details are correct are:

  • Title
  • Category
  • URL alias

All other fields are empty.

Thanks,

Dale.


techutopia
Total posts: 202
23 Aug 2014 22:03

Hi,

I also note that when I try to do another import, the same record is not overwritten.

I am choosing a "field with unique ID" to try an update exisitng records, but a new one is created each time.

Thanks.

Dale.


techutopia
Total posts: 202
23 Aug 2014 22:08

Here are the two lines invloved in "my_path/public_html/components/com_cobalt/fields/url/url.php" if that helps.

Line 93 : foreach($value as $i => $val) Line 135 : foreach($value AS $link)

Thanks,

Dale.


Sergey
Total posts: 13,748
24 Aug 2014 04:41

techutopia Here are the two lines invloved in "my_path/public_html/components/com_cobalt/fields/url/url.php" if that helps.

Line 93 : foreach($value as $i => $val) Line 135 : foreach($value AS $link)

Those lines I have fixed. The problem now in

techutopia fatal error: Object of class stdClass could not be converted to string in my_path/public_html/libraries/framework/Joomla/Registry/Registry.php on line 172

I applied fixes. Will update URL field in one how. Please follow.


techutopia
Total posts: 202
27 Aug 2014 00:00

Hi Sergey,

Sorry, I did not quite understand your message - are both problems now fixed?

Thanks,

Dale.


Sergey
Total posts: 13,748
28 Aug 2014 13:35

Try to download URL field already updated. And see if error has gone.


Guest
04 Nov 2014 05:53

Доброе утро. Меня тоже замучил этот url.php ...../public_html/components/com_cobalt/library/php/helpers/url.php on line 12 Версия Кобалта совсем свежая и медиа тоже.


Guest
04 Nov 2014 05:54

А строка 12 вот это define('COBS', $component_params->get('separator', ':'));


Konstantin
Total posts: 1,113
04 Nov 2014 10:57

А что за ошибка там? они описано до "./public_html/components/com_cobalt/library/php/helpers/url.php on line 12" и когда она возникает?


Guest
04 Nov 2014 12:31

Как я понял это связан с mijoshop вот здесь решения но не совсем понятно как http://www.mintjoomla.com/support/community-forum/user-item/1686-golfads/48-cobalt-8/2098-important-issue-with-joomla-3-0.html


Guest
05 Nov 2014 05:47

Может быть кто то знает как этот человек решил эту проблемму ? что то написал но не понятно как это делать


Guest
05 Nov 2014 08:43

Может кто то знает куда что надо вставит или поменят ?


Konstantin
Total posts: 1,113
05 Nov 2014 10:17

Здесь все понятно, не знаю насчет роботоспособности.

Here is the solution provided by mijo team to avoid such conflict:

\components\com_mijoshop\mijoshop\router.php

line 138: self::$url = new Url(HTTP_SERVER, self::$config->get('config_secure') ? HTTPS_SERVER : HTTP_SERVER);

line 138: self::$url = new Mijosoft\Url(HTTP_SERVER, self::$config->get('config_secure') ? HTTPS_SERVER : HTTP_SERVER);

line 141 : self::$url = new Url(self::$config->get('config_url'), self::$config->get('config_secure') ? self::$config->get('config_ssl') : self::$config->get('config_url'));

line 141 : self::$url = new Mijosoft\Url(self::$config->get('config_url'), self::$config->get('config_secure') ? self::$config->get('config_ssl') : self::$config->get('config_url'));

\components\com_mijoshop\opencart\system\library\url.php

add following line

namespace Mijosoft;

before following line

line 14 : defined('_JEXEC') or die('Restricted access');

Нужно в этом файле \components\com_mijoshop\mijoshop\router.php

заменить указанные строки на прдеставленные, и в начале файла прописать namespace Mijosoft;


Guest
05 Nov 2014 10:41

Спасибо огромное за ответ, не работает прбовал


Guest
05 Nov 2014 11:35

Здесь 2 файла, в обеих надо добавить этот код или как ?


Konstantin
Total posts: 1,113
06 Nov 2014 04:46

Дайте доступ к Вашему сайту и ссылку где эта ошибка появляется, попробую.

Powered by Cobalt