tmatbcorp VIP
Total posts: 41
04 Dec 2014 15:52

Hi,

I have juste upgraded my client's website (visible here: https://recrutement.terre.defense.gouv.fr ) from Joomla 2.5 to Joomla 3.3.6. I have upgraded all my extensions to fit J3.

Regarding Cobalt, we had Cobalt 7.9259 and I have installed pkg_cobalt.j3.media.v.8.79.zip then pkg_cobalt.j3.everything.v.8.602.zip.

When navigating on the website, a lot of errors show: - on front page, errors like "Warning: Illegal string offset 'image' in C:\wamp\www\components\com_cobalt\fields\image\image.php on line 202" - on parent menu, for example when clicking on "Sans BAC", blank page with fatal error "Call to a member function get() on a non-object in C:\wamp\www\components\com_cobalt\views\records\tmpl\default_menu_default.php on line 25" - on administrator interface, when I click on a record, a pop-in is displayed with an error message: "Error No permission Error: CB Login module not created (required)."

I have no idea on what to do about the first two errors, the third one might be a Community Builder issue, I am not sure...

I have tried upgrading first to Cobalt 7.9793 before installing Cobalt 8 but the result is the same.

Could you please help me? I you do, please explain very clearly because I am completely new to Joomla and do not know the application code since a team from another company had written it, we have no way of contacting them and we do not have any documentation (it sucks so much!).

Thanks a lot in advance.

Last Modified: 12 Jan 2015


tmatbcorp VIP
Total posts: 41
16 Dec 2014 08:46

Fields are not empty because I can see them and their values in $item->fields. Fields are lost when it goes from $item->fields to $item->fields_by_id. View access is set to "Public", are there other rights to define?


tmatbcorp VIP
Total posts: 41
18 Dec 2014 16:51

Hello again,

Could you please tell me where fields_by_id function is in Cobalt code? I would like to understand why the fields are not retrieved.

Thank you


Sergey
Total posts: 13,748
19 Dec 2014 02:56

tmatbcorp Could you please tell me where fields_by_id function is in Cobalt code? I would like to understand why the fields are not retrieved.

In models/record.php there is _prepareRecord() method. It gets fields from model/fields.php and getRecordFields() method.


tmatbcorp VIP
Total posts: 41
02 Jan 2015 11:50

Hi,

Happy new year :)!

I had a look at _prepareItem() method in models/record.php (_prepareRecord() does not exist) and I found that my problem comes from this code lines:

$method = $client == 'list' ? 'onRenderList' : 'onRenderFull';
if($field->type == 'image' && $client == 'compare')
{
    $method = 'onRenderList';
}
$result = $field->$method($data, $type, $section);
$result = trim($result);

$data, $type and $section are not empty but $result is, I don't understand why.

Any idea?


Konstantin
Total posts: 1,113
05 Jan 2015 09:27

How you debug result? Result empty for all fields?


tmatbcorp VIP
Total posts: 41
05 Jan 2015 09:59

Hi,

I use var_dump($result) or print_r($result). It is not empty for all the fields, only some of them, for examples the images.

The next line code checks whether $result is empty or null and when true the line code continue; is played and the field is not added to the field_by_id list. If I comment the continue; line, I still get the problem as in my template, it is $field->result that is used to display the informations.

How does $field->$method() function work? Why would it return nothing for some of the fields and not others?


pepperstreet VIP
Total posts: 3,837
05 Jan 2015 16:08

tmatbcorp Why would it return nothing for some of the fields and not others?

Maybe a dumb question ...

Do you have different display settings for your fields? i.e. show in INTRO, show in LIST

Bildschirmfoto 2015-01-05 um 17.07.39

Possibly the fields' values/results depend on them?


Konstantin
Total posts: 1,113
06 Jan 2015 05:22

tmatbcorp Why would it return nothing for some of the fields and not others?

It may be as pepperstreet said

pepperstreet you have different display settings for your fields

or fields has no values.


tmatbcorp VIP
Total posts: 41
06 Jan 2015 10:51

Thanks for your answers but as I said on december 15th:

tmatbcorp All the fields I want to display have "Yes" set for intro and full views

And, as posted on december 11th, fields are not empty:

tmatbcorp [fields] => Array ( [8] => {"image":"images\/actualites\/SDR_2014_2\/2014_11_14.jpg","image_title":""} [9] => blabla1 [10] => blabla2 )

But fields_by_id are:

tmatbcorp [fields_by_id] => Array ( [9] => JFormFieldCTextarea Object ( lot of parameters ) )

The problem really comes from $field->result which itself comes from $field->$method() (itself possibly linked to some other configuration I do not know about).


Konstantin
Total posts: 1,113
06 Jan 2015 10:56

Can you give access to your site and link where the problem and I check it.


tmatbcorp VIP
Total posts: 41
06 Jan 2015 13:14

Sadly I can't, the website is hosted on the server of the company I am working for and it is not available to outside people :(


Sergey
Total posts: 13,748
06 Jan 2015 15:14

I think you will have to setup online dev instance of your site. Unfortunately we cannot help you much if we have no access to investigate. In some cases we can assist for local installations, but in your case we have reached the point when we have to test it in order to be helpfull.


tmatbcorp VIP
Total posts: 41
07 Jan 2015 09:20

I can't give you access but would it be possible to maybe share my screen with you? Or send you some specific files?


Konstantin
Total posts: 1,113
07 Jan 2015 09:37

No, we must have ftp access and online access to site by internet.


Sergey
Total posts: 13,748
08 Jan 2015 06:13

tmatbcorp I can't give you access but would it be possible to maybe share my screen with you? Or send you some specific files?

Just pack your site with AAkeeba Backup, and deploy on any server you have. It will take only 1 hour.

Share screen will not work in your case. If it would be simple bug or error, yes we could go that way. But here, is transfer from 7 to 8 which may create hundreds of issues. Will be very hard to do it over screen share session.


tmatbcorp VIP
Total posts: 41
12 Jan 2015 08:50

Hi,

We can't give you access, not because it is too complicated or would take too much time, but because of our client's privacy requests.

Anyway, we finally found and corrected the problem with the display of the images.

Apparently, images'data are stored in DB as JSON but not handled as such within the code.

We fixed the problem by modifying /components/com_cobalt/models/fields.php file: line 208 we added

if($field->field_type == 'image'){
    $record_fields[$field->id] = json_decode($record_fields[$field->id], TRUE);
}

Now images are displayed fine.

Powered by Cobalt