Title: Bug with paths when using WP under Git
Last modified: April 26, 2017

---

# Bug with paths when using WP under Git

 *  Resolved [sam_nazarko](https://wordpress.org/support/users/sam_nazarko/)
 * (@sam_nazarko)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/bug-with-paths-when-using-wp-under-git/)
 * Hi
 * I’m using WordPress and WooCommerce with Git. WordPress is configured as a submodule
   and I have slightly different directories for wp-content.
 * Since this migration, I’m unable to view a PDF invoice from the Order page. When
   I click the link, I receive the following error:
 *     ```
       Template not found! Check if the following file exists:
       wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/pdf/Simple/invoice.php
       ```
   
 * The file does exist, but it exists under a different path:
 * `./website2017/content/plugins/woocommerce-pdf-invoices-packing-slips/templates/
   pdf/Simple/invoice.php`
 * It seems that it doesn’t work as expected when using a custom WP_CONTENT_DIR 
   in wp-config.php. Here’s my wp-config.php:
 *     ```
               define('WP_SITEURL', 'https://' . $_SERVER['SERVER_NAME'] . '/cms');
               define('WP_HOME',    'https://' . $_SERVER['SERVER_NAME'] . '');
               define('WP_CONTENT_DIR', dirname(__FILE__) . '/content');
               define('WP_CONTENT_URL', 'https://' . $_SERVER['SERVER_NAME'] . '/content');
               define('UPLOADS', '../uploads');
       ```
   
 * Thanks in advance
 * Sam

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/bug-with-paths-when-using-wp-under-git/#post-9108496)
 * Hi Sam,
    Not sure what’s going on here. The plugin doesn’t specifically use wp-
   content at all, it stores a path relative to `ABSPATH`. Here’s the process:
    - When opening the settings page, it scans the plugin folder + `/templates/pdf/`
      and the theme+child theme folder for custom templates. It lists these in the
      dropdown, by default this will be just “Simple”.
    - When you save the settings, it stores the path relative to `ABSPATH` of that
      template
    - When you create the PDF, it reads the settings (relative template path) and
      prepends `ABSPATH` to it.
 * The only thing I can think of would be that you have moved to another site which
   doesn’t use wp-content, in which case you will need to select the correct folder
   on the settings page, save the settings and you should be fine. If that’s not
   the case, I don’t have an explanation for why this is not working.
 * Is this on Apache or IIS?
 * Let me know if the above helps to solve this issue!
 * Ewout
 *  Thread Starter [sam_nazarko](https://wordpress.org/support/users/sam_nazarko/)
 * (@sam_nazarko)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/bug-with-paths-when-using-wp-under-git/#post-9108574)
 * Hi Ewout,
 * Thanks for the reply.
 * I’m using Apache. I can confirm that saving settings for the plugin fixed the
   issue.
 * Sam

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug with paths when using WP under Git’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [sam_nazarko](https://wordpress.org/support/users/sam_nazarko/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/bug-with-paths-when-using-wp-under-git/#post-9108574)
 * Status: resolved