0
Warning: Invalid argument supplied for foreach() in C:\wamp\www\Joomla\administrator\components\com_modules\views\module\tmpl\edit_positions.php on line 31

(not sure how to upload image here)

Any idea why this is happening?

Lodder
  • 19,758
  • 10
  • 59
  • 100
Vivsa
  • 1
  • 1
  • can you show some code you have used for your template? Not the XML or CSS, but the index.php file and any other PHP files you have created – Lodder Jan 12 '14 at 16:47
  • We need to see more of the code. That error is pretty self explanatory, something is wrong with that foreach at line 31 of the edit_positins.php file. However, without seeing the code, we can't really help. – mituw16 Jan 12 '14 at 16:48
  • Is there any way to upload a file here? – Vivsa Jan 12 '14 at 16:49
  • You don't need to upload the file, you can copy paste the code into a code block – mituw16 Jan 12 '14 at 16:51
  • either show the code in the question or put the code on PasteBin. @mituw16 - The error isn't actually coming from *edit_positins.php* as this is a core Joomla file, there is an error within the template code causing this error – Lodder Jan 12 '14 at 16:51
  • @Lodder, fair point. I know php very well, but have never done any joomla! – mituw16 Jan 12 '14 at 16:52
  • http://pastebin.com/JE92mCjN this is the php file I created @Lodder – Vivsa Jan 12 '14 at 16:54
  • Ahh I think I see the problem, you have assigned module to specific position but have not defined them in the index.php file. You have for the main menu but none of the others. Use the following to define a module position: `` – Lodder Jan 12 '14 at 17:00
  • Try disabling all modules on your site apart from the main menu and see if the error still shows. – Lodder Jan 12 '14 at 17:00
  • @Lodder Sorry, newbie here, where else am I supposed to define a module position? – Vivsa Jan 12 '14 at 17:03
  • In the *index.php*. I provided the code above. – Lodder Jan 12 '14 at 17:11
  • @Lodder I changed the name of my main_menu module to position_menu in my php file and in my template details file and I still get the invalid argument notice. (i tried disabling all the other modules and that didn't work) – Vivsa Jan 12 '14 at 17:20
  • Please show the xml for the positions from templateDetails.xml. Did you uninstall the other templates? If not, take a look at how protostar or beez work. Also, I really would not recommend hard coding so much in your index.php, we have CSS and modules for a reason. Keep index.php for php not design elements. – Elin Jan 12 '14 at 18:54
  • @Elin http://pastebin.com/f80FfFB2 Here is my xml file, are you refering to the images I put in the code? I looked at the other templates and still couldn't figure out why my template was doing this... – Vivsa Jan 12 '14 at 21:17
  • @Vivsa - Ok now you see in your XML, you have defined the position **position_menu**, but in your *index.php*, you have used **name="main_menu"** which is different. So you're basically trying to call a position that hasn't been defined. – Lodder Jan 12 '14 at 22:46
  • @Lodder I changed it in both after you told me to, this is just the xml file after the change and php file before... Problem still not solved... – Vivsa Jan 13 '14 at 08:47
  • Super weird to me, but the problem was solved by adding positions such as left and user1 in the xml file, even though I didn't use them in my php file. – Vivsa Jan 13 '14 at 22:11

0 Answers0