[Solved] Synchronize Media keeps asking me to re-synchronize...

Started by Cleanshooter, October 24, 2011, 17:17:44 PM

Previous topic - Next topic

Cleanshooter

I'm stuck on this one...  I'm running VM 1.9.8j version 4534 (Updated to HEAD this morning after I started having a problem) on Joomla! 1.7.0

It might be because I'm running the site on XAMPP right now but I hit syncronize media button and it says following:
        Found prior migration process, resume migration maxScriptTime 26 maxMemoryLimit 96
        Synchronized 401 media for product in directory images/stories/virtuemart/product/
        The synchronisation is not finished, please execute again

I click again I get same info with a different Synchronized number... and again and again... I click it like 20 times and it never finished.  I have around 850 images in the database right now.   It seems like it's not finding the correct previous process to me but I'm not sure to be honest.

I'm going to take this revision to my live server and see if I get same result. 
- Cleanshooter

Cleanshooter

Just double checked that I had updated my tables and turned on my vmdebug...

vmdebug confirms that it's re-sychronizing the same file every time becuase the same product ID #s are showing up over and over.

Now I just need to figure out why.
- Cleanshooter

PRO

I think it only works on main image, not additional image.

IS that your case? 

Cleanshooter

I am talking about the "Synchronize Media to Virtuemart" button in the: Shop > Media Files section...

It used to synchronize the entire folder when I added new images now it just keeps asking me to resynchronize.

I also just discovered something interesting...

I put a debug in the migrator.php line 214
vmdebug("Stored Medias Array", print_r($this->storedMedias));

I suspect I might be using this funciton wrong but the output was rather odd...

vmdebug Stored Medias Array Var1:

1

I was expecting an array of all of my media ids in the database but I only got one id... I could be reading the code wrong here but it seems like this array should be larger...
I'll keep digging

-Cleanshooter
- Cleanshooter

Milbo

I am quite sure the problem is not in the exeSortSearchListQuery.

Maybe in the table storing the migration process is an error.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Cleanshooter

Yeah after further digging it definitely wasn't the exeSortSearchListQuery... ( I couldn't even find it ).

It's just odd to me that when I vmdebug the the $this->_data form the getFiles funciton in the media.php I can see the data needed but when I vmdebug it after it's called in the migrator.php ( line 211 $this->storedMedias = $this->mediaModel->getFiles(false, true, false);)  it is empty.  As in there is nothing there...

Well time for lunch here I'll keep cracking at it after lunch.

- Cleanshooter

Cleanshooter

Quote from: Milbo on October 24, 2011, 18:31:08 PM
Maybe in the table storing the migration process is an error.

I tried resetting the virtuemart_migration_oldtonew_ids table with out any improvement...

The code recreated id 1 the way it should have then the re-synchronize started again.

@Milbo are u able to replicate issue or no?
- Cleanshooter

Cleanshooter

It must have been a session issue.... I got logged out over lunch and when I logged back in everything was working again...

Given that once the new session started the issue disappeared I wonder if it is an issue with Joomla?  Has anyone else ever had issues that resolved them selves by logging out and logging back in? I seem to remember dealing with a similar problem not to long ago can't remember what though.
- Cleanshooter

PRO


Milbo

It works for me. I just did it today.

BTW:
vmdebug("Stored Medias Array", print_r($this->storedMedias));

Dont use print_r in vmdebug, the function itself is doing it for you. You also can add more than one variable.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

BTw, the model took some JRequest variables, maybe you had them set somehow. I moved the JRequest part to the views where it is actually needed, it may make the difference, it is just a bit cleaner now.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Cleanshooter

Quote from: BanquetTables.pro on October 24, 2011, 19:40:54 PM
system cache plugin turned on?

No it's disabled...

Quote from: Milbo on October 24, 2011, 19:46:18 PM

BTW:
vmdebug("Stored Medias Array", print_r($this->storedMedias));

Dont use print_r in vmdebug, the function itself is doing it for you. You also can add more than one variable.

I thought it did but when nothing came out I tried something crazy :-P thx

Quote from: Milbo on October 24, 2011, 20:15:23 PM
BTw, the model took some JRequest variables, maybe you had them set somehow. I moved the JRequest part to the views where it is actually needed, it may make the difference, it is just a bit cleaner now.

If I run into the issue again I'll be sure to look at them so I can figure out what happened...
- Cleanshooter