Jump to content

Archived

This topic is now archived and is closed to further replies.

Fiskaz

Invalid argument supplied for foreach()

Recommended Posts

Danny

Hi,

 

The issue is you have used a TextBox section to embed a tweet, which contains javascript. In order to add tweets to your site you should either use a MediaBox or the NextBox club section. To resolve your issue you're going to need to remove the code. However, this will likely not be possible as the error caused will prevent you from loading DMS on that page.

Therefore, you're going to have to remove the template, to do this you will need to go to a page not using that template so the error isn't present. So to use the DMS editor again, go to a page that is not assigned that template, then the DMS editor should work.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Fiskaz

Hi Danny,

 

As it has already crashed my whole website there is not option get back the whole content. Also my question is when i added code in one template why it has crashed my whole template.

 

Also i have searched on forum topic i found this topic. but as you mentioned in the best answer i have different template for each page but it still cause my every page template. 

 

I am not able to create new page. Can i give you my website credential because i am not getting what i have to do.

 

 

http://forum.pagelines.com/topic/35708-dms-template-thing-broken/page-2?hl=invalid%20argument

Share this post


Link to post
Share on other sites
Fiskaz

The topic which i have sent you is seems same ike what happens with me.

Share this post


Link to post
Share on other sites
Danny

Can you PM me your admin username/password and link to the site in question, so I can take a look myself.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Fiskaz

Hi Danny,

I have sent you my website credential on our personal conversation email.

Share this post


Link to post
Share on other sites
Danny

OK, you have a number of problems, which you're going to need to address.

 

You will first need to update both WordPress and DMS to their latest versions, as both are out of date. Once both are up to date, we can take another look at your server. I have also disabled all your active plugins to see if they were the cause.

 

However, when I viewed your error message and debug info, I noticed that you're using a Windows based server. Windows based servers have strange configurations and aren't very good for hosting websites. Therefore, I think the best course of action for you would be to switch to a linux based server.

 

 


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Fiskaz

Hi Danny, Right now i have just updated the WordPress but DMS is not showing any update message. Also my all website do well on windows server that's why i dont want to move to linux server however i know it will be best to use linux but right now i can't move.

Share this post


Link to post
Share on other sites
Fiskaz

Hi Danny,

 

Did you get any solution? Also when i checked today all website template was deleted from the website but if you check my this page About us all content are there i don't know what's going on.

Share this post


Link to post
Share on other sites
Fiskaz

Hi martin"] @[member="Danny"] @[member="Simon_P"] @[member="James B

 

Can anyone please check my issue. I tried to remove error coming on the page but it is not saving anything on my website after refresh it shows blank page.

 

I have gone through the error and made changes in core file over here

foreach( (array)$tpls->get_all() as $index => $template)                                                             on line number 119               (File name:editor.importexport.php)

foreach( (array)$all_templates as $index => $template)                                                              on line number 319                 (File name:editor.templates.php)

foreach( (array)$custom_template_handler->get_all() as $index => $t)                                       on line number 552                 (File name:editor.templates.php)

 

But when i add anything using drag and drop after refresh it is blank.

 

 

Please check this issue.

Website:http://contestraja.com/

 

 

Share this post


Link to post
Share on other sites
Danny

I think the best course of action for you would be to reinstall DMS, as you have made edits to the core files and this isn't something we recommend nor provide support for.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Fiskaz

i did reinstall DMS and then i tried to change core files.

Share this post


Link to post
Share on other sites
Fiskaz

but the problem is canvas section don't save anything in template area. If you check the screenshot it has deleted my other default template file as well.

Share this post


Link to post
Share on other sites
Danny

Please reinstall DMS and do not edit any core files, as we do not recommend it nor can we provide support to users who have.

Once you have reinstalled DMS, please record any issues you're having, as I am now confused as to what your issue(s) are. First you said that you received errors and couldn't access the DMS editor. This was caused by you adding scripts to a TextBox section, which should only be used for text and basic HTML such as <strong>, <em>, <br> etc..

 

You're also running your site on a Windows based server, these servers are configured oddly and are not recommended for hosting websites. You should be using a Linux based server and finally, you're now saying that you have edited the core files and have encounter an issue with the Canvas section and that somehow your templates have been deleted. The only way you can delete the templates to my knowledge is if you have deleted them yourself or the code changes you made to the core files have caused this.

 

So please reinstall DMS and do not edit the core files, then record your issue using an app like Jing or QuickCast. Then we can take a closer look. However, if I was you, the first thing I would do is switch to a linux based server.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Fiskaz
Ok, Danny i will reinstall and let you know

Share this post


Link to post
Share on other sites
Fiskaz

Hi Danny,

 

I am going to tell you in brief what happened to the site.

 

1. I was embedding twitter post in textbox as i did earlier many times but this time when i did it give me below error.

PHP Warning: Invalid argument supplied for foreach() in D:\Inetpub\vhosts\fiskaz.com\contestraja.com\wp-content\themes\dms\dms\editor\editor.importexport.php on line 119
PHP Warning: Invalid argument supplied for foreach() in D:\Inetpub\vhosts\fiskaz.com\contestraja.com\wp-content\themes\dms\dms\editor\editor.importexport.php on line 119
PHP Warning: Invalid argument supplied for foreach() in D:\Inetpub\vhosts\fiskaz.com\contestraja.com\wp-content\themes\dms\dms\editor\editor.templates.php on line 313

PHP Warning: Invalid argument supplied for foreach() in D:\Inetpub\vhosts\fiskaz.com\contestraja.com\wp-content\themes\dms\dms\editor\editor.importexport.php on line 119

 

2.Then i tried to find some solution on google and i found the small code to add in foreach as you can see below what i did in the core files.

foreach( (array)$tpls->get_all() as $index => $template)                                                             on line number 119               (File name:editor.importexport.php)

foreach( (array)$all_templates as $index => $template)                                                              on line number 319                 (File name:editor.templates.php)

foreach( (array)$custom_template_handler->get_all() as $index => $t)                                       on line number 552                 (File name:editor.templates.php)

 

3.As you mentioned i should reinstall i did and i got the same error (1st step).

Then i try to do 2nd step and I manage to remove error. But I am not able to save any content any thing on the page. When I add any text-box or anything in the template section after page refresh it is blank.

 

Also the default template was deleted automatically when I was adding twitter post in the text-box

 

4. Today I removed all files from my WordPress and downloaded fresh files.

But as i tried to activate the DMS i got the same error. I have screen cast the process please have a look.

http://www.screencast.com/t/5eoLPX1UxoLf

 

 

 

Share this post


Link to post
Share on other sites
Fiskaz

My mistake in 4th Step i have removed Pagelines files.

Share this post


Link to post
Share on other sites
Danny

I mentioned on the PM's I sent you, that the first issue you had is that you're adding custom code i.e. advanced HTML/JavaScript to a TextBox section. The TextBox section should only be used for text and basic HTML i.e. <strong>, <em>, <ul> etc.. not what you have added. Therefore, to resolve your issue, please stop adding your tweet posts to a TextBox section and try instead to add them to either a MediaBox or NextBox section. This should stop the error messages you're encountering when adding that code to a TextBox.

 


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Fiskaz

Ok, If i add more then 20 twitter post in mediabox are you sure it will not affect the same it did in past.

Share this post


Link to post
Share on other sites
Danny

If you're going to add that many, then I think the best course of action is to add them directly into a WordPress page or post content area instead, as the MediaBox section supports HTML, JavaScript is not HTML. You could also create your own section.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • stijnxo
      By stijnxo+
      Ik like to use the following Plug-in in my DMS Theme, but can' get it to work. My DMS Editor is not loading anymore if I paste this short code in a page, textbox or mediabox: [wpdatatable id=1]
      Plug-in: WPDataTables Plug-in 
      Shortcode:  [wpdatatable id=1]
      Website: http://gentleclinics.nl/prijslijst-heren/

      Anyone experience with this plug-in and DMS.
    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
×