News:

Support the VirtueMart project and become a member

Main Menu

So I messed up a default.php file...

Started by Leneux, August 09, 2012, 00:21:50 AM

Previous topic - Next topic

Leneux

I was trying to increase the character count of the product short description, and somehow totally screwed it up.  I'm not sure exactly how I screwed it up, it should have been a very simple change in the code.
I didn't make a backup of the file, because I figured I could just ctrl+z - well the jokes on me.

The file I was attempting to change was...

/components/com_virtuemart/views/category/tmpl/default.php

the line of code I altered was...

<?php // Product Short Description
   if(!empty($product->product_s_desc)) { ?>
   <p class="product_s_desc">
   <?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?>
                  </p>
                  <?php } ?>

...I changed the '40' to '500', to allow for more character spaces - at least I thought.  But when I made the change, and saved the file - the whole darn thing flipped on its backside, and I don't even recognize the code anymore.  Ctrl+z wouldn't even undo my error... I shouldn't have used notepad i guess.

So my question is, do I now have to uninstall all the VM extensions and reinstall, fresh, to make it right again?  Doing so wouldn't be a huge problem, since I haven't really started on any content for the store yet.  Or does anyone have any other suggestions on how to fix this?

Also, and more importantly, what the heck did I do wrong???  I have very little experience with PhP and MySQL databases, but I understand it all.  Should I have used Notepad++ or Dreamweaver instead?  Why would Notepad flip out on a PhP file like that?  Or did I just plain do something incorrect.

I appreciate everyone taking the time to read my questions, I eagerly await your responses...


Joomla! Version 2.5 / VM2

ivus

Hi Leneux,

2 solutions...


  • Download a fresh copy of VM (same version tho), extract it onto your computer, find the file and copy it over.
  • go through the SVN repository and grab the code from there.

You shouldn't need to re-install VM. BUT if these solutions don't work, you may have another underlying issue. Be sure to check your error.log.

Good luck.  ;D

Leneux

Excellent!  I'm back in business.

I did toy with that idea, but figured there is no way it would be compatible with all the changes I've made so far - I didn't think it would be the "same" file anymore.  But it is!
Thank you so much for your help :)

P.S. I realize now I should have probably posted this in the general channel, as this one focuses on problems Virtuemart causes, rather than the ones that I do. lol apologies.

Leneux

One additional update...

I just succeeded in changing short product description from 40 characters to 500.  The problem was that I was using regular Notepad to make changes to the default.php file.  So if I've learned anything through all this its Notepad++, Dreamweaver or nothing.  Don't edit PhP files with Notepad.

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/