Giter Club home page Giter Club logo

alfresco-community-share's Issues

Rule boolean parameter conversion error

Description

When editing a rule with an action which has a boolean parameter, the error is thrown which prevents proper form rendering (especially "Save" button action is not assigned).

Error

TypeError: paramValue.toLowerCase is not a function
    at Alfresco.RuleConfigActionCustom._convertType (rule-config_4a306578c85215e54534b99e5391c237.js:2023:31)
    at Alfresco.RuleConfigActionCustom._createCheckbox (rule-config_4a306578c85215e54534b99e5391c237.js:1596:37)
    at Alfresco.RuleConfigActionCustom.edit (rule-config_4a306578c85215e54534b99e5391c237.js:1375:28)
    at Alfresco.RuleConfigActionCustom.RuleConfig__createConfigParameterUI [as _createConfigParameterUI] (rule-config_4a306578c85215e54534b99e5391c237.js:950:40)
    at Alfresco.RuleConfigActionCustom.RuleConfig__createConfigUI [as _createConfigUI] (rule-config_4a306578c85215e54534b99e5391c237.js:772:15)
    at Alfresco.RuleConfigActionCustom.RuleConfig_displayRulConfigs [as displayRuleConfigs] (rule-config_4a306578c85215e54534b99e5391c237.js:394:18)
    at RuleEdit_constructor.RuleEditUtil_displayRuleConfigs [as displayRuleConfigs] (rule-config-util_c10402243abfc520abac3eaed8927dd7.js:290:21)
    at RuleEdit_constructor.RuleEdit_displayRule [as displayRule] (rule-edit_e5e6ad389f43182b4768920572895dbf.js:383:15)
    at RuleEdit_constructor.RuleEdit_onRuleConfigsReady [as onRuleConfigsReady] (rule-edit_e5e6ad389f43182b4768920572895dbf.js:344:18)
    at RuleEdit_constructor.RuleEditUtil_onRuleConfigReady [as onRuleConfigReady] (rule-config-util_c10402243abfc520abac3eaed8927dd7.js:173:15)

Steps to reproduce

  1. Go to Repository and Manage rules
  2. Create a new rule with action "Copy" (which contains a checkbox parameter)
  3. Edit an action

Proposed solution

In the rule-config.js file in the _convertType() function in the "d:boolean" if, add the following code:

if (typeof paramValue === "boolean") {
    return paramValue;
}

Affected file

rule-config.js

Affected version

Tested on Alfresco Community 7.2.0.

Background

It seems the connected error has been already reported by the Seng Liaw (MNT-22238) and @alexbalmus tried to fix it here which is the cause of this error.
@alexbalmus boolean values from "Set property" action are strings, whereas boolean values from action parameters are boolean values - probably this led to the mistake.

Shared files - double file download

Bug description

MNT-20685 commit made by @antoniojfelix introduced a bug, where a file is downloaded two times ( firstly to JS, secondly to client).
It creates 2x bigger server load and a client have to wait 2x longer. It is especially visible on the bigger files.

Proposed fix

As a fix, in the Pdfjs.js file in the downloadIfLoggedIn() function I propose to check if url contanis the "alfresco-noauth" and for the logged in validation, "/touch" API can be used.
Sample code:

downloadIfLoggedIn : function PdfJs_downloadIfLoggedIn(url)
{
      // check if site is shared
      // if yes, always download, no matter of the login state
      if(url.includes("/alfresco-noauth/"))
      {
      window.open(url, "_blank");
      return;
      }
      var request = new XMLHttpRequest();
      request.onreadystatechange = function() {
          if (this.status === 401)
          {
              // user is logged out, reload should move to login page
              window.location.reload();
          }
          else if (this.readyState == 4 && this.status == 200) {
              window.open(url, "_blank");
          }
      };
      
      // check if user has been logged out
      request.open("GET", Alfresco.constants.PROXY_URI + "touch", true);
      request.send();
}

Using the code above, there might be a problem with a 301 redirect and CORS protection (i.e. when using external auth).

Affected versions

Alfresco 7.2. and onwards.

Add "offline_acess" to the scope for oAuth.

Add "offline_acess" to the scope for oAuth.
See line:

Reason:
Provider such as Authentik does require the client to request "offline_acess" to send a refresh token. See https://docs.goauthentik.io/docs/providers/oauth2/#refresh_token

I can of course create a PR, but it is a very simple change.
Se also Alfresco/alfresco-community-repo#2513

Compilation error - maven-war-plugin no-args constructor

I am unable to compile alfresco-community-share project. I tried on 2 machines, using different tags. I tried to follow CONTRIBUTING.md but it seems to be outdated.
It only worked while using Java from ORACLE (proprietary one)

mvn clean package output:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.6:war (default-war) on project share: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.6:war failed: Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
[ERROR] ---- Debugging information ----
[ERROR] message             : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
[ERROR] cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
[ERROR] cause-message       : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
[ERROR] class               : org.apache.maven.plugin.war.util.WebappStructure
[ERROR] required-type       : org.apache.maven.plugin.war.util.WebappStructure
[ERROR] converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
[ERROR] path                : /webapp-structure
[ERROR] version             : null
[ERROR] -------------------------------

mvn -v output:

Maven home: /usr/share/maven
Java version: 11.0.13, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.13.0-28-generic", arch: "amd64", family: "unix"

I've found many similar threads ( 1, 2, 3, 4 )
Specifying 2.6 maven-war-plugin version does not seem to work

Search Problems

I tried to search a document in Alfresco and, when i searched the document with the complete name (example: Project Overview.ppt), it appears in the search, but when I take one character out (Project Overview.pp), it doesn't appear in the share.

Shared files - broken link

MNT-22612 commit introduced a bug, where a document-details button link in the shared page is invalid - "example.com/share/s/Encode.forHtmlAttribute(/share/page/quickshare-redirect?id=XXX)"

Proposed change in the share/src/main/resources/alfresco/site-webscripts/org/alfresco/components/quickshare/header.get.html.ftl line 32:
<a href="${linkButton.href?xhtml}" class="brand-button ${linkButton.cssClass!""}" tabindex="0">${linkButton.label?xhtml}</a>

I guess @rrajoria tried to used OWASP Encode utility but it is not available on the Freemakrer's side. Such an expression should also be inside Freemarker's expression ${}. Anyway, ?xhtml should be enough to protect against XSS

Multiple display erros in Google Chrome

While Share is working fine in Safari and Firefox we experience multiple major display issues in Chrome. Almost all labels are displayed as the variable name. It also prevents navigation trough pages since the pagination module is not displayed at all. - No errors in the browser console.

Examples of display issues in Chrome:
Login Display:
image

Pagination:
image

FF and Safari:
Screenshot 2023-12-04 at 13 04 21

Alfresco Share 7.1 shows some english text when browser locale is Brazilian Portuguese

Original: #1 (comment)

In Alfresco Share 7.1 version, some parts of Share always shows texts in english, even when the browser locale is Brazillian Portuguese:

7 1 7 1_

Using 6.2 it works just fine, it never happened:

6 2

For the record, i'm using Angel's docker installer: https://github.com/Alfresco/alfresco-docker-installer/

I couldn't figure out what's going on... I'm assuming it's a bug in Share. Thanks!

In Alfresco Share 7.1 version, some parts of Share always shows texts in english, even when the browser locale is Brazillian Portuguese:

7 1 7 1_

Using 6.2 it works just fine, it never happened:

6 2

For the record, i'm using Angel's docker installer: https://github.com/Alfresco/alfresco-docker-installer/

I couldn't figure out what's going on... I'm assuming it's a bug in Share. Thanks!

In case anyone else is having this problem, just configure Java locale and that will solve the problem...

-Duser.country=BR
-Duser.region=BR
-Duser.language=pt
-Duser.timezone=America/Sao_Paulo

The indicated solution works, after inserting in alfresco and share conatainers.
however the display will always be in the informed language, and it changes the date patterns.
Any hope for a fix?
I tested it in version 7.3.0-M2, and it has the same error.

Failed clone due to TAS test data in git-lfs

It is currently impossible (as far as I can see) to clone this project by a member of the community (i.e. to prepare a PR) due to the inclusion of test data by TAS which is separately resolved / downloaded via git-lfs, failing on missing permissions.

Repeated result of clone attempts (including one with an attempt to ignore the path via .gitignore on a parent path):

D:\Alfresco>git clone [email protected]:Alfresco/alfresco-community-share.git
Cloning into 'alfresco-community-share'...
Enter passphrase for key '/c/Users/axelf/.ssh/id_rsa':
remote: Enumerating objects: 229637, done.
remote: Counting objects: 100% (8733/8733), done.
remote: Compressing objects: 100% (3159/3159), done.
remote: Total 229637 (delta 5297), reused 8463 (delta 5139), pack-reused 220904
Receiving objects: 100% (229637/229637), 193.96 MiB | 13.57 MiB/s, done.
Resolving deltas: 100% (128640/128640), done.
Updating files: 100% (9546/9546), done.
Downloading alfresco-tas-share-test/testdata/Video2.WMV (87 KB)
Error downloading object: alfresco-tas-share-test/testdata/Video2.WMV (a4bf038): Smudge error: Error downloading alfresco-tas-share-test/testdata/Video2.WMV (a4bf038cf8d0ca93c9acd30395406b5e968d3e5743d2ad68e798fdcccd0c783d): batch request: [email protected]: Permission denied (publickey).: exit status 255

Errors logged to 'D:\Alfresco\alfresco-community-share\.git\lfs\logs\20230106T123652.9598694.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: alfresco-tas-share-test/testdata/Video2.WMV: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

"Error loading items" on Users page

I have created one user. When I log in to the admin console as "admin" to see my users, the table only shows an error and no users. I can see in the dev console that I'm getting a 404. See screenshots.

Alfresco404
AlfrescoErrorLoadingItems

When I log in as the user I am able to view and edit my profile.

I am running Alfresco7.2 Community edition installed with Ansible. Cent OS 7, Python 3.8.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.