Frontend editing products - 2.0.12f: won't work

Started by lliseil, October 03, 2012, 22:11:45 PM

Previous topic - Next topic

lliseil

Nice new features with 2.0.12b!

Now frontend editing won't work by default. Had to apply a hack to ~/libraries/joomla/registry/registry.php for it to work. EDIT: Unfortunately, causes malfunctioning in the backend.

Vm 2.0.11e, 2.0.12b (site updated from 2.0.10)
Joomla 2.5.7
PHP 5.3.17

Before hacking the core file:
Logged into the frontend with the Vendor user. Clic "Edit" icon. Then comes the following error message, whether clicking "Save" or "Cancel", with/without editing the product :
Fatal error: Cannot access empty property in /site-path/libraries/joomla/registry/registry.php on line 336 Fatal error: Access to undeclared static property: JLoader::$classes in /site-path/libraries/loader.php on line 195
- The URL while in editing window    : ~/index.php?option=com_virtuemart&tmpl=component&view=product&task=edit&virtuemart_product_id=628
- The URL after clicking SAVE or Cancel: ~/index.php?option=com_virtuemart

Editing libraries/joomla/registry/registry.php solved this issue so far: Cancel, Save after editing working fine. Reference's below:

Lines 331-337, original:
// Traverse the registry to find the correct node for the result.
for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++)
         {
            if (!isset($node->$nodes[$i]) && ($i != $n))
            {
               $node->$nodes[$i] = new stdClass;
            }
            $node = $node->$nodes[$i];
         }


Edited:
for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++)
         {   if(strlen($nodes[$i]>0)) {
                if (!isset($node->$nodes[$i]) && ($i != $n))
                {
                   $node->$nodes[$i] = new stdClass;
                }
                $node = $node->$nodes[$i];
                }
         }

Patch is taken from: [bug] with JRegistry when the path contains empty fields (double dots)

Only misbehaviour we found since a week we're editing through frontend is that return to the frontpage after each editing.

EDIT:
* Behaviour and workaround are identical between Vm 2.0.12b and 2.0.11e.
* WTH, our hack has an unwanted consequence: I just confirmed that it causes Joomla 2.5 to forbid editing in the backend! With the dreadful message:
"You are not authorized to see this page [with the ID of the Menu/Article/Module]"
- A thread solved is a thread [SOLVED]! (a memo for myself)

Zaggiff

#1
Quote from: lliseil on October 03, 2012, 22:11:45 PM
Nice new features with 2.0.12b!

Now frontend editing won't work by default. Had to apply a hack to ~/libraries/joomla/registry/registry.php for it to work. EDIT: Unfortunately, causes malfunctioning in the backend.

Edited:
for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++)
         {   if(strlen($nodes[$i]>0)) {
                if (!isset($node->$nodes[$i]) && ($i != $n))
                {
                   $node->$nodes[$i] = new stdClass;
                }
                $node = $node->$nodes[$i];
                }
         }

...


Just need to do some fix to the code a bit.

Instead of

{   if(strlen($nodes[$i]>0)) {

put  this

{   if(strlen($nodes[$i])>0) {

and no more "that it causes Joomla 2.5 to forbid editing in the backend!"

lliseil

Thank you Zaggiff.

Well fixed the line ":-} but now with VirtueMart 2.0.12f:
- won't save (with registry.php hacked)
- still can't edit and same error (without editing registry.php)
Have to go: client's calling . . .
- A thread solved is a thread [SOLVED]! (a memo for myself)

jguy

While you guys are talking about whether Front End editing is working properly, I cant even find out where to enable it, what am I missing

Can someone please point me to some docs on this subject or provide me with some instructions, because I am now really confused. Does it work like the old way, with an admin menu becoming available or do I stil need to do something in the Joomla ACL

Any help would be much appreciated

gpessoa

#4
First, you have to login as admin,

Them you will find a button on product front shop (see image attached)

By the way, mine works fine!


[attachment cleanup by admin]
J 4.4.4; VM 4.2.6; PHP 8.3.6

jguy

Thanks for your reply gpessoa

Yes this part seems to be working, but I am looking for access to the Admin area of the shop component, like in the old VM. It used to allow configuration while logged in as storeadmin

Currently the front end editing seems to only allow the editing of an existing product (unless I am missing something here). The little side tab menu doesn't bring up the full admin menu as expected

Having read through the forum, is this why some are talking about setting up a new special user group in the Joomla ACL and creating a special permission menu option to the VM2 backend admin area?



gpessoa

Sorry, I can`t help you on this.
I`m not familiar with VM1 and my knowledge of VM2 is also limited, since I only meet it a few weeks ago.
One thing I Know, This VM2 has a lot to grow up!
J 4.4.4; VM 4.2.6; PHP 8.3.6

jguy