Jump to content


JReviews is the best selling Joomla Reviews Component and WordPress Reviews Plugin. It's also in a class of its own as a Business Directory.
Photo
- - - - -

Form json file errors


  • Please log in to reply
13 replies to this topic

#1 DanielH

DanielH

    Advanced Member

  • Members
  • PipPipPip
  • 369 posts

Posted 05 October 2016 - 05:04 AM

When using custom json files I'm getting this error in the fields manager when using overrides.

 

Warning: file_get_contents(/path/users/path/apps/path/public/contacts_grid_list.json): failed to open stream: No such file or directory in /path/users/path/apps/path/public/components/com_jreviews/jreviews/admin_controllers/fields_controller.php on line 207

 

Which is the loading of the files.

 

I take it using json file overrides for creating new forms cannot be accomplished being there are no original files with the same name and all json code must be added to the json editor?

 

However the file does show in the custom field Load Schema dropdown, it loads and works loading the form correctly on the submit page plus the output to the template.

 

Thanks

Daniel


Edited by DanielH, 05 October 2016 - 07:29 AM.


#2 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 05 October 2016 - 07:24 AM

Checked the code quickly and you are probably right. Even though the file will be recognized and appear in the list, we have a hardcoded path in javascript for the location of the files. It's not a priority now to fix this since you do have the option of pasting the schema in the field, but we'll keep it in mind for a future update. Thanks for letting us know.



#3 DanielH

DanielH

    Advanced Member

  • Members
  • PipPipPip
  • 369 posts

Posted 05 October 2016 - 07:37 AM

No problem! I added the files to the core for now just to stop the errors.



#4 n00bster

n00bster

    Advanced Member

  • Members
  • PipPipPip
  • 300 posts
  • LocationAustria

Posted 08 August 2017 - 01:36 AM

Alejandro, this issue is not jet solved am i right?


[PHP 7.0] [Joomla 3.8] [Easysocial 2.1] [jReviews 2.7]


#5 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 08 August 2017 - 10:15 AM

Right. You should change the path in the JSON schema.



#6 n00bster

n00bster

    Advanced Member

  • Members
  • PipPipPip
  • 300 posts
  • LocationAustria

Posted 08 August 2017 - 02:25 PM

do i understand this right, i should change this line in this file "business_hours_timezone.json" :

"$ref": "DEFINITIONS_PATH\/timezones.php",

[PHP 7.0] [Joomla 3.8] [Easysocial 2.1] [jReviews 2.7]


#7 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 08 August 2017 - 02:53 PM

Yes. Instead of DEFINITIONS_PATH you would use the relative URL path to the actual location of the file which you can place anywhere you want on your site.



#8 n00bster

n00bster

    Advanced Member

  • Members
  • PipPipPip
  • 300 posts
  • LocationAustria

Posted 09 August 2017 - 01:50 AM

ok. i placed the file "business_hours_timezone.json" to this override path below:

root/templates/jreviews_overrides/views/themes/mythemename/fields_formbuilder

now i want to point back the $refs to the originals:

"$ref": "/components/com_jreviews/jreviews/views/themes/default/fields_formbuilder/definitions/timezones.php",

but this does not work, the errors in the backend are not gone.

Warning: file_get_contents(/www/htdocs/root/main/business_hours_timezone.json): failed to open stream: No such file or directory in /www/htdocs/root/main/components/com_jreviews/jreviews/admin_controllers/fields_controller.php on line 237

what did i wrong?


[PHP 7.0] [Joomla 3.8] [Easysocial 2.1] [jReviews 2.7]


#9 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 09 August 2017 - 06:30 AM

If I am not mistaken, the original issue was only with the $ref path not being able to load from overrides, not with the JSON file which you can put in overrides, but you should probably change the name so you can differentiate it from the original file. So if you are not changing the PHP file you don't need to change anything. 



#10 n00bster

n00bster

    Advanced Member

  • Members
  • PipPipPip
  • 300 posts
  • LocationAustria

Posted 09 August 2017 - 08:07 AM

sorry i do not understand why i should rename this file - to make a override both files must have the same name??

the thing is fundamental, i have changed this files because for language translations:

root/components/com_jreviews/jreviews/views/themes/default/fields_formbuilder/business_hours_timezone.json

so, that i'm save when it comes to updates i want to override this file in this folder:

root/templates/jreviews_overrides/views/themes/mythemename/fields_formbuilder/business_hours_timezone.json

and here i run in the problem, since i have copied this i got errors in the backend.

the thing is, i forgot this file to save last time before i made one of the latest updates and guess what - i lost my translations - not cool.


[PHP 7.0] [Joomla 3.8] [Easysocial 2.1] [jReviews 2.7]


#11 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 09 August 2017 - 08:11 AM

Then don't rename it, but inside the file you need to change the first key "name" so you can differentiate the original from your override. Feel free to open a ticket with access and the name of the custom field if you want me to check this on your site.



#12 n00bster

n00bster

    Advanced Member

  • Members
  • PipPipPip
  • 300 posts
  • LocationAustria

Posted 09 August 2017 - 10:43 AM

god it.

 

last question for this. where do you build up the html UL List with the days in it? i ask because i want to add on the active LI element a css class to style this line a bit.

https://www.screenca...m/t/i5S8dKaqinD


[PHP 7.0] [Joomla 3.8] [Easysocial 2.1] [jReviews 2.7]


#13 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 09 August 2017 - 10:58 AM

It already has a class of jrBusiness-open or jrBusiness-closed . You are not able to use those?

 

I see now that you want to add something to the <li> tag.  You can modify the theme file in the defalt theme folder: /fields_phpformat/business_hours_schedule.thtml


Edited by Alejandro, 09 August 2017 - 11:00 AM.
Correction to answer


#14 n00bster

n00bster

    Advanced Member

  • Members
  • PipPipPip
  • 300 posts
  • LocationAustria

Posted 10 August 2017 - 12:29 AM

perfect, thx!


[PHP 7.0] [Joomla 3.8] [Easysocial 2.1] [jReviews 2.7]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users