Graham Orford

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)

I’m happy to report that I’ve found the problem and fixed it. So this ticket can be closed.

The issue was down to a custom search template which was using a query on the wp_ahm_files table. This table is no longer used, and a new query on wp_posts did the trick.

I suspect your logic says if old field has a value but the new one doesn’t then use the old one. That isn’t always going to work. I think the migration from old field to new should be a one-off process. I’ve just removed an expiry date and the document can be downloaded again but the edit page is still showing the old expiry date (as the new field is now blank you are pulling in the old data once more). I think this needs a little more work.

I’ve also noticed that the following information is lost when upgrading from v3 to v4.

Attached document / link
Category
Allow Access (you have provided a fix to set everything to “All Visitors” so that works in my situation)
Link template
Page template

All these can of course be reset by the customer, but doing so for every download is a lot of work. They already have the problem of editing all the pages that reference documents due to the ID change, and then I need to create .htaccess rewrites to direct old ID links to the new ones.

I read there is a v3 to v4 migration tool. Is this tool still required? I have only today found a link for it, and you haven’t asked if I’d run this tool so I’m guessing it is no longer required. I’ve tried running it on another installation but the thing just spins and nothing seems to happen. Please can you confirm what the current migration process is. Do I need to run this tool?

in reply to: Support for do_shortcode in widgets #110188

I can indeed, but only if you don’t put single quotes around the ID numbers. Armed with that knowledge I went back to the PHP and tried again.

The following code in my sidebar.php allows me to select the latest documents and display them with their unique link templates.

The other thing that was tripping me up is now needing to echo the do_shortcode which wasn’t required before (I assume WordPress changed something there).

<?php
global $wpdb;
$start=0;
$limit=5;
$res = $wpdb->get_results("select ID from {$wpdb->prefix}posts WHERE post_type = 'wpdmpro' and post_status = 'publish' order by ID DESC limit $start, $limit",ARRAY_A);
$showDocuments='';
foreach($res as $media) { $showDocuments .= '[wpdm_package id='.$media['ID'].']'; } 
echo do_shortcode("$showDocuments");
?>

note: The graves (slanted single quotes) have been removed from the above as they are used as code tags in this editor.

Yes I can see the field, but they are all blank. However when I try to downlaod the documents it tells me it has expired and shows a date (which is correct).

So, my question is, why isn’t the date displaying when editing the document?

All the expired documents were done prior to upgrading to the latest version, so I suspect the problem is with old expired documents, and a new one would work fine.

That is causing my client a great deal of upset, but from a technical viewpoint I understand that switching to the WordPress post model you are now using a dynamicially allocated id number. Thanks for confirming it is working as expected, I can rule my concerns it was a database issue.

They have created 1200 documents and 900 of them have reached their expiry date. In the old version they can only see 300 remaining ones, but in the test system (which is testing the new version) they can see all 1200. When we edit old ones the expiry data is blank but if I view the document it tells me it is expired (and provides the date). If you are editting a document that has an expiry date shouldn’t it show the expiry date?

Currently my recommendation to them is to bin all 1200 documents, and then un-bin the ones they want to keep live. They then note the new document id and updates the pages that reference them. Better to work on 300, then weed out the unwanted 900. Unless you can recommend a better way of sorting live from expired documents.

Thanks, I added the code to function.php and that did the trick.

My next problem isn’t one I think we need to fix, but I think you should be aware of it. The package IDs are different after migrating the database. This means all the references in the pages are wrong and will need to be corrected. This is rather unfortunate, but as it’s only impacting my test system I don’t think it’ll be a problem in my situation. I assume when we upgrade the live system we won’t have a problem as databases aren’t being moved.

Thanks again for your excellent support.

I’ve got another issue that I’d like to share with you.

I’ve found why we lost all our documents, the WordPress backup tool I was using didn’t handle all the tables, so I found a better plugin which found (I hope) all the tables. The test site now has all the documents listed again.

However, I can’t see of them as the “Allow Access” settings appear to have been lost. Looking at the source site it has them listed as “All visitors” but once migrated the values are blank. Can you shed any light on how these settings might have been lost? If you can tell me which table they are stored in I can check if they migrated correctly.

Thanks for fixing that, good to know an upgrade needs to be a delete and re-install.

I fixed the widgets, they got messed up on the way.

I noticed that the page templates are still reporting as “Pre-designed templates can’t be deleted or edited from this section. But you can clone any of them and edit as your own. If you seriously want to edit any pre-designed template you have to edit those directly edting php files at /download-manager/templates/ dir”

However this information is no longer correct. The template are stored in “/download-manager/tpls/page-templates” directory. A similar change has also been made to the link templates. Users need to manually copy those to the correct location if they have made their own (hopefully they took a copy before deleting the old version).

The old templates don’t work any more, so they will need correcting, but that all makes sense, things change.

Thanks for the prompt support and fixes/advice.

Well that was a silly mistake of mine. Thank you.

I’ve updated to the latest version, but when you viewing the packages you get the following error (once WP Debug was enabled)…

Notice: Undefined index: id in /home3/lithium1/public_html/medsmanagement/wp-content/plugins/download-manager/modules/canonical-url.php on line 138

Fatal error: Uncaught Error: Call to undefined function get_wpdm_meta() in /home3/lithium1/public_html/medsmanagement/wp-content/plugins/download-manager/modules/misc.php:34 Stack trace: #0 /home3/lithium1/public_html/medsmanagement/wp-includes/class-wp-hook.php(288): wpdm_preview_slider(NULL) #1 /home3/lithium1/public_html/medsmanagement/wp-includes/plugin.php(208): WP_Hook->apply_filters(NULL, Array) #2 /home3/lithium1/public_html/medsmanagement/wp-content/plugins/download-manager/libs/class.Package.php(1383): apply_filters(‘wdm_before_fetc…’, Array, ‘<!– WPDM Templ…’, ‘page’) #3 /home3/lithium1/public_html/medsmanagement/wp-content/plugins/download-manager/wpdm-functions.php(1548): WPDM\Package::fetchTemplate(‘<!– WPDM Templ…’, Array, ‘page’) #4 /home3/lithium1/public_html/medsmanagement/wp-content/plugins/download-manager/wpdm-functions.php(580): wpdm_fetch_template(‘page-template-1…’, 5549, ‘page’) #5 /home3/lithium1/public_html/medsmanagement/wp-includes/class-wp-hook.php(286): wpdm_downloadable(‘<p>wpdmpr in /home3/lithium1/public_html/medsmanagement/wp-content/plugins/download-manager/modules/misc.php on line 34

This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 10 total)