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

Add content/publish policy, ref EZP-26070 #2

Merged
merged 1 commit into from
Jan 9, 2017
Merged

Conversation

emodric
Copy link
Member

@emodric emodric commented Jan 9, 2017

https://jira.ez.no/browse/EZP-26070
ezsystems/ezpublish-kernel#1868

This PR adds a content/publish policy, unused by the Legacy itself, instead used for compatibility with eZ Publish 6.8.x kernel.

@emodric
Copy link
Member Author

emodric commented Jan 9, 2017

Failure is related to packagist.org issue, which seems to have lost versions for ezdemo-ls-extension tags (and probably other *-ls-extension packages too)

@emodric emodric merged commit 8d9d2d9 into master Jan 9, 2017
@andrerom
Copy link
Contributor

andrerom commented Jan 9, 2017

How does legacy behave without this? Can't seem to see any description of what kind of issue it is causing.

@emodric
Copy link
Member Author

emodric commented Jan 9, 2017

It doesn't, at least not yet. I didn't fully test as I don't have time currently. This PR is of preventive nature only.

@emodric emodric deleted the content_publish branch January 12, 2017 14:40
@emodric
Copy link
Member Author

emodric commented Feb 1, 2017

@andrerom FYI, Legacy will not break if it encounters an unknown policy. It will happily edit and save the role with an unknown policy, however, this patch is still required because policy limitations for content/publish are not recognized or editable otherwise.

pkamps added a commit to pkamps/ezpublish-legacy that referenced this pull request Apr 6, 2023
I'm running this code with PHP8.2 and it fails with following error message:

Unexpected error, the message was : explode(): Argument netgen#2 ($string) must be of type string, array given in ./ezpublish_legacy/lib/ezutils/classes/ezini.php on line 1751

As you can see in the original code, sometimes this function gets an array for the $path variable. In that case, the original code was picking the first element of the array if it exists. In case of an empty array, $path is still an array. 

The PHP function explode `explode( '/', $path );` expects a string for $path. PHP7 and lower just return FALSE. PHP8 triggers an error and stops the execution.

My code changes just make sure that $path is a string and it returns 'undefined' in case of an empty array for the $path variable.
@pkamps pkamps mentioned this pull request Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants