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

Update to support 11 SP12 & SP14 #1

Open
EliJDonahue opened this issue Aug 7, 2018 · 22 comments
Open

Update to support 11 SP12 & SP14 #1

EliJDonahue opened this issue Aug 7, 2018 · 22 comments
Assignees
Labels
Help Wanted Assistance is welcome. Type: Bug Something is not working. Type: Upgrade Needs to support a newer version of Aras Innovator.

Comments

@EliJDonahue
Copy link
Member

We've received a report that the project does not currently work with Aras 11 SP12:

custom-form-css works with Sp9 and SP7, but it does not import into Sp12 while using the package importer. Even if the method required for overriding the default style and classifications is done by manually creating the method and adding it to the form, it does not work.

I'm guessing this is related to changes in the client-side controls between 11 SP9 and 11 SP12.

@EliJDonahue EliJDonahue added Type: Bug Something is not working. Help Wanted Assistance is welcome. labels Aug 7, 2018
@EliJDonahue EliJDonahue self-assigned this Aug 7, 2018
@sachinbijadi
Copy link

Hey Eli! Any updates on this issue?

@EliJDonahue
Copy link
Member Author

Hi Sachin,

As a test, I applied the import package and code tree patch to my local 11 SP12 instance. There are a few fields that are not styled correctly (outlined in yellow below), but it worked for the most part. I'll work on fixing the fields that aren't getting styled.

image

Are you seeing similar behavior, or are you getting an error when you try to import the package?

Eli

@sachinbijadi
Copy link

Thanks ELi,

Yup, The importer says there is error and cannot import package. I will see if I can try that again and paste a screenshot of the error message

@EliJDonahue
Copy link
Member Author

That would be helpful, thanks. You can also find a log file in the "log" folder where your import.exe file is located. That should have more info about the error.

@sachinbijadi
Copy link

2018-8-13.16-55.log
import error - css form customization

@sachinbijadi
Copy link

An even i tried manually adding html code from your tutorial, to the individual fields, along with attached stylesheet, the dropdown menu field dsiplayed similar behaviour to your schreenshot, in that they still displayed the old style.

@EliJDonahue
Copy link
Member Author

I think the import error is occurring because the description field is too long. Try entering a shorter description like "Custom Form CSS community project".

@EliJDonahue
Copy link
Member Author

Hey Sachin, I have released a new version of the project to support Aras 11 SP12-14. Check it out and let me know if it works for you.

@sachinbijadi
Copy link

was able to import package.......gonna test the form customization now in the client instance! Thanks! Will get back to you with any issues.

@sachinbijadi
Copy link

Hey Eli,
I am facing the following issues:

  1. The part form field entities are int he form list but the fields have disappeared from the form:
    part form disappeared

  2. For the document form I took the steps you have mentioned (add mystyles.css and add method onLoad). However there is some weird issue with loading the form as seen below:
    document form preview issue

and if you double click to open:
document form loading error

@sachinbijadi
Copy link

This is the technical message that came with the error popup dor the document form:
"
Event handler failed with message: TypeError: Cannot read property 'parentElement' of undefined [function onload$user$handler(e) { try { if (onload1(e) === false) return false; } catch (exp) { aras.AlertError(aras.getResource('', 'ui_methods_ex.event_handler_failed'), aras.getResource('', 'ui_methods_ex.event_handler_failure_msg', exp.description ? exp.description : (exp + ' [' +arguments.callee.toString()+ ']')), aras.getResource('','common.client_side_err')); return false; } }]
"

Stack Trace - Client Side Error

@EliJDonahue
Copy link
Member Author

Hi Sachin,

I am not able to reproduce the issues you're seeing. I have a few questions to help troubleshoot the issue:

  • What browser (and version) are you using?
  • Do you see the same behavior if you log out, clear your browser cache, and login again?
  • Do you have any other form events on your Document form?

@sachinbijadi
Copy link

Hey Eli,
Here are the answers to those queries:

  1. I am using the Google Chrome (Version 68.0.3440.106 (Official Build) (64-bit))
  2. On the test server (my PC) installed client, I don't see the erratic behavior with the Part when I do that (interesting!). (I will have to get back to you about the production server because there is some network issue at the moment)
  3. No, I don't have any other form events on the Document form

For item 2, even though the form loads up, the dropdown fields look a bit weird as below:
part form2

I will clear cache and try the production server again tomorrow. Will that likely resolve issue (i.e Part form fields disappeared)?

@sachinbijadi
Copy link

Is there any way to unimport the package and import in again properly?

@EliJDonahue
Copy link
Member Author

The screenshot almost looks like v1.2 behavior instead of v2.0.0. I recommend downloading v2.0.0 again, importing the package, and reapplying the code tree patch. The v2.0.0 release has changes from v1.2 in both the import and code tree, so you'll need to apply both. This should effectively overwrite any previous files/methods you applied.

@sachinbijadi
Copy link

On our production server and test server, i imported the v2 package again and recopied the codetree folder as suggested.

Test server:

No issues loading anymore. Part form loaded correctly on start up of innovator. On folowing instructions for document form, it also opens correctly. There are some graphics issue with preview with both chrome and firefox, and chrome shows 2 arrows in dropdown field. Will post this separately as a new graphics issue.

Production Server:

1] Document form issues:

This time I opened innovator with firefox. On the document form (in the production server) i verified that there are no other form events apart from the 2 default ones along with the new new labs_customstyle method. However the form does not preview still and shows error message on loading. When I removed the labs_style method from teh form event, tehn the form previews (albeiit without the correct style for dropdown field in preview mode) and no error message appears on double clikcing to open form.

[Is this an issue specifically to this server instance? because the loading was not an issue in the test server!]
--------------------------------------------------
With labs_style method added to form events and csutom stylesheet added in form body (+edits to white spaces, formatting of text, etc.)
2 no preview
2 1 load error

If method is removed, then I see the following for the document form:
2 3 preview
2 4 doc form no error

2] Part form issues:

With no meddling, just re-import of package and copying of codetree into root folder, the default part form still looks like this - all fields are still in a disappeared state:
2 5 part form disappeared

@sachinbijadi
Copy link

With issue 2, I dont remember if i had already previously modified the default part form before importing customFormCSSv2.

In any case I had a copy of the part form (not sure if it was OOTB or with some mods (some fields removed, etc.) and then i manually added the method and stylesheet as explained for the document form in the isntructions (I also had to add in the custom field CSS's for respective fields for user_group and iteminfo group to get the borders and boxes). When I made this form the deafult view for part in the part tiemtype, i still get loading error like with document form (refer earlier post) but the custom icon and state text in the bottom right in big bold letters (which should happen from the method) are missing.
[Test server on the right - default part form with no modifications,
Prod. server on right - copy part form with manual addition of method and stylesheet and addition of new fields required(custom_icon, user_group, etc.)]
2 6 part form test v prod server

@EliJDonahue
Copy link
Member Author

Hi Sachin,

Regarding the client error you're seeing, you can try making the following modification to the labs_StyleForm method:

Current:

// get element associated with an item property's "button"
getItemFieldButton = function (field) {
    var itms = document.getElementsByClassName(field);
    var parentEl = itms[0].parentElement;
    return parentEl.getElementsByTagName("button");
};

// replace icon on an item property's "button"
updateItemFieldIcon = function (field, icon) {
    var btn = getItemFieldButton(field);
    setAttributeOnAll(btn, 'src', icon);
    return btn;
};

Modified:

// get element associated with an item property's "button"
getItemFieldButton = function (field) {
    var itms = document.getElementsByClassName(field);
    if (itms)
    {
        var parentEl = itms[0].parentElement;
        return parentEl.getElementsByTagName("button");
    }
    return null;    // couldn't find button
};

// replace icon on an item property's "button"
updateItemFieldIcon = function (field, icon) {
    var btn = getItemFieldButton(field);
    if (btn)
        setAttributeOnAll(btn, 'src', icon);
    return btn;
};

@sachinbijadi
Copy link

Hey Eli,

I tried that - I replaced the section of the method code with the modified stuff. Error unfortunately still persists. Form does not preview in TOC view, On loading a part or document an error window is generated, and the custom icons won't appear!

Regards
Sachin

@sachinbijadi
Copy link

Is there something specific to our installed instance that is causing this issue? Because as I stated earlier the package works just fine (apart from some graphics issues with the drop-down icon in chrome) on the test server. The problem is happening only on the production server. Is there any way to purge the package and import it again? or is there any other way to troubleshoot it? Because I also have issues with workflow activity completion forms (Says cannot pickup IIS directory, but still processes the completion anyways)

@EliJDonahue
Copy link
Member Author

Hi Sachin,

One quick check - can you confirm that your production environment contains the code tree patch for this project? You can check by making sure the following exist in the code tree:

  • Innovator\Client\customer\myStyles.css
  • Innovator\Client\customer\svg (contains several svg graphics for custom icons)

If you don't have these files in your code tree, or they don't exist in the correct relative path, try applying the code tree patch and clearing your browser cache.

If the code tree isn't the issue, I'm not sure exactly what would be causing the behavior you're describing. Unfortunately there isn't any easy way to "purge" or back an imported package out of a database. You can however manually undo all of the changes made by the import package. In this case, you can do the following:

  1. Backup your database.
  2. Edit the Part form (and any other form using the labs_StyleForm method):
    • Remove the Form Event for the labs_StyleForm method
    • Remove the contents of the CSS field in the Form Body tab
    • Remove the custom_icon and user_group fields
    • Edit the HTML contents of the item_info field and remove class="info_group"
  3. Save the Part form.
  4. Delete the labs_StyleForm method.
  5. Delete the aras.labs.CustomFormCss package definition (Administration > Configuration > Package Definition in the TOC)
  6. Log out of Innovator.
  7. Clear your browser cache and log back in to Innovator.

These steps should remove the database changes applied by the import package. When you login again, you should see the default part form (though you may need to adjust the positioning of some fields).

Once you have your production environment in a working state for your users, I recommend setting up a new instance for testing with your production database (and code tree, if you have code tree customizations). Then you can compare that environment to your test environment and see if there are any differences that may be causing trouble.

Hope this helps!

Eli

On an unrelated note: The IIS directory issue is occurring because Innovator is trying to send an email but the SMTP server isn't configured correctly. To avoid this error you can configure the SMTP server, disable the email notification on the workflow, or set up email debugging. See these steps for details. Note that only option 1 will result in emails being sent. Options 2 and 3 will prevent emails from being sent to users.

@sachinbijadi
Copy link

Hey Eli,

Thanks for taking the time to look into this more in spite of it becoming a really long thread!

Part1:
can you confirm that your production environment contains the code tree patch for this project?
Yes. I do have the svg icons as well as the Mystyles sheet within the customer folder in the innovator code tree.

Part2: I will make sure to "purge" by removing the method. However, even though it is not ideal, I found a way to use the css code from the style sheet in teh External CSS field on the form design and play around to some extent with the look and feel of some fields. However I assume, without the method, there is no way to make the menu dropdown field type to follow the new style.

Part3:
I actually tried to set up a second instance of the aras client to connect to the same database for testing. Is that what you mean as well - a second instance on the same server for the same database? When I tried to use the innovator installer, it only provides options for modify, repair or remove, and not for a new installation. I looked online for tips on making the installer work again but couldn't seem to figure out how to get that to happen? Any tips?
Also, if i play around with methods, form changes etc., I can still view the data in the database being used by the team, but not affect anything in the main production instance?

Part4: I couldn't get the smtp connection to work with our Google suite setup, but at least I am not getting errors because of that anymore, after I installed hmailserver and setup SMTP there. Even though it doesn't work for now I am happy that it doesn't keep making pop-up errors! :D

@EliJDonahue EliJDonahue added the Type: Upgrade Needs to support a newer version of Aras Innovator. label Sep 26, 2018
@cgillis-aras cgillis-aras assigned k0marsh and unassigned sampoearas Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Assistance is welcome. Type: Bug Something is not working. Type: Upgrade Needs to support a newer version of Aras Innovator.
Projects
None yet
Development

No branches or pull requests

4 participants