Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There isn't Print section in admin console #68

Closed
Intelligent2013 opened this issue Apr 24, 2021 · 11 comments · Fixed by #73
Closed

There isn't Print section in admin console #68

Intelligent2013 opened this issue Apr 24, 2021 · 11 comments · Fixed by #73
Assignees
Labels
type:bug Something isn't working. type:good-first-issue Good for newcomers.
Milestone

Comments

@Intelligent2013
Copy link

Intelligent2013 commented Apr 24, 2021

I've tried to install plugin v.1.1.2 on WordPress v.5.7.1, v.5.6.2, 5.5.4, 5.5 and 5.4.2 and can't find the section 'Print'

Steps to Reproduce

  1. Install WordPress version 5.5 (I use PHP development environment from https://www.apachefriends.org/index.html)
  2. Open Admin console -> Plugins -> Add new -> find 'Eight Day Week' -> Install Now -> Activate.
  3. Reload Admin console.
  4. There isn't section 'Print' at left pane.

Expected behavior

Screenshots
image

Environment information

  • OS: Windows 7 64-bit
  • Browser and version: Firefox 88.0
  • Theme and version: Twenty Twenty
  • Other installed plugin(s) and version(s): none
  • PHP version: 7.3.27
@Intelligent2013 Intelligent2013 added the type:bug Something isn't working. label Apr 24, 2021
@dinhtungdu
Copy link
Contributor

Hi @Intelligent2013,

I can't reproduce your issue.

I'm thinking about the permission issue. Can you please download the plugin from https://wordpress.org/plugins/eight-day-week-print-workflow/ and install it manually to see if it fixes your issue?

If the method above doesn't work, can you try setting WP_DEBUG to true and reactivate the plugin to get more clues about what is happening?

@dinhtungdu dinhtungdu added the needs:feedback This requires reporter feedback to better understand the request. label Apr 24, 2021
@Intelligent2013
Copy link
Author

Hi @dinhtungdu thank you for your quick answer.

I'm thinking about the permission issue. Can you please download the plugin from https://wordpress.org/plugins/eight-day-week-print-workflow/ and install it manually to see if it fixes your issue

I've downloaded eight-day-week-print-workflow.1.1.2.zip and installed it via 'Upload plugin', and activated - no success, again there isn't 'Print' section.

If the method above doesn't work, can you try setting WP_DEBUG to true and reactivate the plugin to get more clues about what is happening?

In wp-config.php I've set:

define( 'WP_DEBUG', true );

and repeated all steps for reactivate the plugin. No errors or messages. Then deleted it and installed again - no errors or messages.

May be there is some non compatibility between my PHP version 7.3.27 and plugin requirements? What is PHP version do you installed?

@dinhtungdu
Copy link
Contributor

@Intelligent2013 I'm using PHP 7.3.11 for my localhost and EDW works as expected for me.

@Intelligent2013
Copy link
Author

Intelligent2013 commented Apr 25, 2021

I've installed AMPPS package - the same issue.

But looks like I've found an issue in the code.
In the file wp-content\plugins\eight-day-week-print-workflow\eight-day-week.php there is code:

function edw_bootstrap() {

	$map = edw_build_namespace_map();

	if ( ! $map ) {
		return;
	}

	$core_file = EDW_INC . 'functions/core.php';

	if( ! isset( $map[ $core_file ] ) ) {
		return;
	}

In my environment (Windows 7 64-bit) $map contains this data:

{ 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\admin-menu-page.php"]=> string(31) "\Eight_Day_Week\Admin_Menu_Page" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\articles.php"]=> string(24) "\Eight_Day_Week\Articles" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\core.php"]=> string(20) "\Eight_Day_Week\Core" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\plugins\article-byline.php"]=> string(128) "\Eight_Day_Week\D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow\Includes\Functions\plugins\Article_Byline" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\plugins\article-count.php"]=> string(127) "\Eight_Day_Week\D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow\Includes\Functions\plugins\Article_Count" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\plugins\article-export.php"]=> string(128) "\Eight_Day_Week\D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow\Includes\Functions\plugins\Article_Export" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\plugins\article-status.php"]=> string(128) "\Eight_Day_Week\D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow\Includes\Functions\plugins\Article_Status" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\plugins\issue-publication.php"]=> string(131) "\Eight_Day_Week\D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow\Includes\Functions\plugins\Issue_Publication" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\plugins\issue-status.php"]=> string(126) "\Eight_Day_Week\D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow\Includes\Functions\plugins\Issue_Status" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\print-issue-columns.php"]=> string(35) "\Eight_Day_Week\Print_Issue_Columns" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\print-issue.php"]=> string(27) "\Eight_Day_Week\Print_Issue" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\sections.php"]=> string(24) "\Eight_Day_Week\Sections" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\taxonomies.php"]=> string(26) "\Eight_Day_Week\Taxonomies" 
["D:\Ampps\www\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\user-roles.php"]=> string(26) "\Eight_Day_Week\User_Roles" 
}

Please note, it contains functions\core.php, but not functions/core.php (as defined the line $core_file = EDW_INC . 'functions/core.php';), therefore function edw_bootstrap() returns none;

I've changed to $core_file = EDW_INC . 'functions\core.php'; and now I see Print section at the left pane. But I didn't try any functions yet and don't sure that are working well. May be I have to change something in another places of code.

@dinhtungdu dinhtungdu removed the needs:feedback This requires reporter feedback to better understand the request. label Apr 26, 2021
@dinhtungdu
Copy link
Contributor

Hi @Intelligent2013, can you please test this branch to check if it fixes your issue? https://github.com/10up/eight-day-week/tree/fix/windows-loading-issue

@Intelligent2013
Copy link
Author

Hi @dinhtungdu,
no, unfortunately.
The reason:

$core_file = D:\xampp\htdocs\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions/core.php`

$map = 
... 
[D:/xampp/htdocs/testsite/wp-content/plugins/eight-day-week-print-workflow/includes/functions/core.php] => \Eight_Day_Week\Core
...

Therefore,

$core_file = EDW_INC . 'functions/core.php';

should be replaced by:

$core_file = str_replace( "\\", "/", EDW_INC . 'functions/core.php' );

also.

After that I see 'Print' section at left pane, but looks like some functions still unavailable. Especially, I can't find how to export as xml to InDesign feature:
image
image

@jeffpaul jeffpaul added this to the 1.2.0 milestone Apr 26, 2021
@samthinkbox
Copy link

Actually wrong way round for / and \ in str_replace for core.php

$core_file = EDW_INC . 'functions/core.php';
should be replaced by:
$core_file = str_replace( "/", "\", EDW_INC . 'functions/core.php' );

this gets the core loaded but also required is a change on ~ line 142 to get the subdirectory / str_replace correct to gather the plugin file namespaces

$sub_directory = str_replace( $dir . '/', '', $path );
should be replaced by:
$sub_directory = str_replace( $dir . '\', '', $path );

@Intelligent2013
Copy link
Author

@samthinkbox
In this case I get:

$core_file=D:\xampp\htdocs\testsite\wp-content\plugins\eight-day-week-print-workflow\includes\functions\core.php
$map = 
...
[D:\xampp\htdocs\testsite\wp-content\plugins\eight-day-week-print-workflow/includes/functions\core.php] => \Eight_Day_Week\Core
...

This variant is working for me (Windows)
change from:

define( 'EDW_PATH',    dirname( __FILE__ ) . '/' );
define( 'EDW_INC',     EDW_PATH . 'includes/' );

to:

define( 'EDW_PATH',    dirname( __FILE__ ) . '\\' );
define( 'EDW_INC',     EDW_PATH . 'includes\\' );

from:

$core_file = EDW_INC . 'functions/core.php';

to

$core_file = str_replace( "/", "\\", EDW_INC . 'functions/core.php' );

from:

$sub_directory = str_replace( $dir . '/', '', $path );

to:

$sub_directory = str_replace( $dir . '\\', '', $path );

but I didn't test it on *nix platforms.

@mnelson4
Copy link
Contributor

I think I had a similar issue: EDW wasn't working on my windows system. I fixed it in my fork here: mnelson4@bafe75a

@dinhtungdu
Copy link
Contributor

Hi @mnelson4, it's a great fix! Do you mind creating a PR to fix this issue?

@mnelson4
Copy link
Contributor

Sure #73

@jeffpaul jeffpaul linked a pull request Aug 25, 2021 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working. type:good-first-issue Good for newcomers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants