Skip to content

Legacy feature support in new stack user siteaccess usage #2

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

Conversation

brookinsconsulting
Copy link
Contributor

Hello Netgen!

We again thank you for your fantastic solution! We took a moment to continue the work we started in #1

This pull request depends on #1 being merged first. Please merge the first pull request and then consider merging this pull request.

During the course of a normal share forum thread, http://share.ez.no/forums/ez-publish-5-platform/select-class-attribute-option-values-ez-5.4

We found several inconsistencies between the default legacy template feature support and the current new stack feature support. Basically the current new stack template can only display selected option identifiers and not the selected option names. I think we can agree that displaying option names is much more user friendly than only identifiers.

In general template logic (and underlying features) were quite different and also did not support the use of custom delimiter display.

The reason for the original limitations in the provided bundle was because the provided FieldType FieldValue Converter was so basic it did not provide support for the use of FieldSettings to the template layer with the stored ContentType Field settings.

In general we borrowed code and syntax for these additions for the default selection FieldType as a guide and customized provided FieldType FieldValue Converter using the legacy datatype's features (but not syntax) also as a guide (as required; not needed).

We have extended the solution in general to provide the same default user siteaccess features as legacy. We think this represents a substantial improvement to the new stack bundle that all user can benefit from, right out of the box! And while we have not ported all features of the legacy datatype specifically since eZ Platform UI is still alpha and feature incomplete (in terms of Content Type definition administration)... we think that our improvements provide a solid basis for current users trying to get the same features provided by the legacy datatype's default use provided feature set in a user siteaccess context and future developers extending the solution further (when eZ Platform UI does provide for Content Type definition administration).

This pull request solves issues surrounding different default use feature support.

We hope that you agree and will merge our improvements!

Note: This is our very first attempt at custom FieldType and Twig template bundle improvements based on legacy datatype and eztpl features. Please be gentle if we have made any errors or omissions :)

Please let us know how this finds you.

Take it eZ!

Cheers,
Brookins Consulting
:octocat:

@brookinsconsulting
Copy link
Contributor Author

Ping @emodric

@emodric
Copy link
Member

emodric commented Apr 6, 2015

Thanks for this one!

However, since I'm traveling at the moment, please allow me a day or two to review this before merging. #1 was just merged, since it was a simple one!

@brookinsconsulting
Copy link
Contributor Author

Hello @emodric

Thank you for your quick reply! Please take your time in reviewing and testing our improvements!

Safe travels :)

Cheers,
Brookins Consulting

{
foreach ( $simpleXml->options->option as $option )
{
$options[(int)$option["id"]] = array( "id" => (string)$option["id"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense for id and priority below to be integers?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is there any specific reason why you set the array keys to id? Why not just use $options[] = array( ... )? I'm worried that someone somewhere will try to use this array as zero-based, while in reality it is be one-based.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @emodric

Thank you for your detailed review. We are reviewing your comments in detail now and will address each of them with further responses and additional changes.

In general and in our defense we would like to say we were attempting to implement the core implementation of the existing legacy datatype as much as possible (where it makes sense).

Though upon review we have made some omissions and mistakes. Your comments have made this clear especially our error with $options[(int)$option["id"]] usage. We will address these with changes very shortly.

Cheers,
Brookins Consulting

@emodric
Copy link
Member

emodric commented Apr 20, 2015

Hi @brookinsconsulting

Once again, thanks for this pull request :) Sorry for being late with the review, but you know how it is, client projects always come first :)

I've made some remarks on your code so check them out in your own time. If you don't have time to correct the issues, let me know, I'll merge the pull request and correct them.

Cheers!

@brookinsconsulting
Copy link
Contributor Author

@emodric

Thank you for your replies. We will address them in detail shortly.

Cheers,
Brookins Consulting

@brookinsconsulting brookinsconsulting force-pushed the legacy_feature_support_in_new_stack_user_siteaccess branch from 071517a to 74e886d Compare May 3, 2015 02:40
@brookinsconsulting
Copy link
Contributor Author

Hello @emodric

We have addressed your comments and concerns with some further improvements.

Please review our improvements and let us know what you think.

Note: We are considering further refactoring (in a separate PR #3 to provide a default template solution to sort the displayed selection options by priority (as stored / used in the FieldType options). We welcome your thoughts on this since we would require a twig filter to sort the fieldSettings options by 'priority'.
EDIT: The twig filter solution we were thinking of using turned out to be incomplete for the features required and was also license incompatible, so we created our own instead.

Cheers,
Brookins Consulting

@brookinsconsulting
Copy link
Contributor Author

Hello @emodric

Apologies for the previous confusion. I have made the changes you suggest as they are what makes more sense and more readable.

I made one other change for simplicity of the potential user who creates a template override which does not want or need a space after the delimiter. I moved the space following the delimiter which was in the template logic into the default delimiter set statement instead.

I also made one other addition to the documentation to clearly explain the last undocumented step to getting their selection content displayed within their own custom template.

I have also merged this change into our other PR #3.

If you like I can flatten all of this PR's changes into a single commit.

Cheers,
Brookins Consulting

…upport for custom FieldSettings values to provide for new stack user siteaccess feature sets to match legacy user siteaccess provided template features and expanded documentation
@brookinsconsulting brookinsconsulting force-pushed the legacy_feature_support_in_new_stack_user_siteaccess branch from db8c17f to 958ef8a Compare May 4, 2015 07:56
@emodric emodric merged commit 958ef8a into netgen:master May 4, 2015
@emodric
Copy link
Member

emodric commented May 4, 2015

Hi @brookinsconsulting

I've merged the pull request and did a couple of fixes in three commits, can you review them to see if there are any problems?

Also, can you now rebase your PR #3 again against master please?

@brookinsconsulting brookinsconsulting deleted the legacy_feature_support_in_new_stack_user_siteaccess branch May 4, 2015 11:30
@brookinsconsulting
Copy link
Contributor Author

Hello @emodric

Thank you very much for your help with these improvements and for merging this morning!

We have rebased PR #3

Cheers,
Brookins Consulting

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