Coder Social home page Coder Social logo

joomla-extensions / weblinks Goto Github PK

View Code? Open in Web Editor NEW
44.0 37.0 88.0 1.68 MB

This repo is meant to hold the decoupled com_weblinks component and related code.

License: GNU General Public License v2.0

PHP 98.51% Shell 0.63% JavaScript 0.86%
php joomla joomla-package weblinks-component weblink

weblinks's Introduction

Weblinks for Joomla!

Build Status

Drone-CI
Build Status

Weblinks for Joomla! provides a component and accompanying extensions to create a directory of weblinks.

How to test a PR

Easily apply changes from a pull requests against this repo: Install the last release of com_weblinks into your Joomla. Install the last release of com_patchtester into your Joomla (weblinks is supported since Version 3.0.0 Alpha 2). Log into your site's administrator section, go to the Patch Tester Component Options (Components -> Patch Tester -> Options) Switch the GitHub Repository to Joomla Weblinks Package. For this you have to fill the field GitHub Project Owner with joomla-extensions and the field GitHub Project Repository with weblinks. Click Save & Close and hit the Fetch Data Button to the the lastest pull requests Click Apply Patch to apply the proposed changes from the pull request. Click Revert Patch to revert an applied patch.

You can read more about the Patch Tester extension on the Joomla! Documentation Wiki.

With Github

If you want to test a patch you can apply the patch via git.

If you cloned this repo under the name upstream - your remote is upstream – you can user the command

git fetch upstream pull/PR_NUMBER/head:BRANCHNUMER

for fetching the branch of the PR #290 this would be

git fetch upstream pull/290/head:move-lang-files

After that you can checkout the branch and start testing.

git checkout move-lang-files

For Linux

Install

1. Open a session and change to the document root of your local webserver.

$ cd /var/www/html/
/var/www/html$

2. Clone the current repository into your webserver root folder

/var/www/html$ git clone [email protected]:joomla-extensions/weblinks.git
Clone nach 'weblinks' ...
remote: Counting objects: 2446, done.
remote: Compressing objects: 100% (75/75), done.
remote: Total 2446 (delta 10), reused 0 (delta 0), pack-reused 2361
Empfange Objekte: 100% (2446/2446), 615.02 KiB | 375.00 KiB/s, Fertig.
Löse Unterschiede auf: 100% (1232/1232), Fertig.
Prüfe Konnektivität ... Fertig.

Are you new with github? Here you can find informations about setting it up: https://help.github.com/articles/set-up-git/ If you get an error you can try git clone https://github.com:joomla-extensions/weblinks.git instead of git clone [email protected]:joomla-extensions/weblinks.git

3. Change to the directory weblinks

/var/www/html$ cd weblinks
/var/www/html/weblinks$

4. This files should be in your weblinks folder.

/var/www/html/weblinks$ ls
codeception.yml  docs		  LICENSE	RoboFile.dist.ini  tests
composer.json	 jed_update.xml   manifest.xml	RoboFile.php
composer.lock	 jorobo.dist.ini  README.md	src

5. Optional: Have a look into composer.json for information what software you will install via composer.

/var/www/html/weblinks$ cat composer.json

or https://github.com/joomla-extensions/weblinks/blob/master/composer.json

Read more about how to install composer here.

6. Optional: If you have problems using composer set a timeout.

/var/www/html/weblinks$export COMPOSER_PROCESS_TIMEOUT=1500;

7. Install via composer

/var/www/html/weblinks$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing symfony/yaml (v3.1.3)
    Downloading: 100%
...
...
Generating autoload files

8. After that you have to build robo

/var/www/html/weblinks$ vendor/bin/robo build

9. Optional: Prepare the database

If you use MySQL or PostgreSQL as database and your user has create database privileges the Database is automatically created by the Joomla installer. But the safest way is to create the database before running Joomla's web installer.

/var/www/html/weblinks$ mysql -u root -p

mysql> create database weblinks;
Query OK, 1 row affected (0,00 sec)

mysql> quit;
Bye

10. Copy the file acceptance.suite.dist.yml into acceptance.suite.dist.yml

/var/www/html/weblinks$ cd tests
/var/www/html/weblinks/tests$ cp acceptance.suite.dist.yml acceptance.suite.yml

11. Update the file acceptance.suite.yml to your needs. At least you have to update the options url, database name and counter_test_url.

/var/www/html/weblinks/tests$ cat acceptance.suite.yml

class_name: AcceptanceTester
modules:
    enabled:
        - JoomlaBrowser
        - AcceptanceHelper
    config:
        JoomlaBrowser:
            url: 'http://localhost/weblinks/tests/joomla-cms3'     # the url that points to the joomla installation at /tests/system/joomla-cms
            browser: 'firefox'
            window_size: 1024x768
            capabilities:
            unexpectedAlertBehaviour: 'accept'
            username: 'admin'                      # UserName for the Administrator
            password: 'admin'                      # Password for the Administrator
            database host: 'localhost'             # place where the Application is Hosted #server Address
            database user: 'root'                  # MySQL Server user ID, usually root
            database password: 'yourPassword'                  # MySQL Server password, usually empty or root
            database name: 'weblinks'         # DB Name, at the Server
            database type: 'mysqli'                # type in lowercase one of the options: MySQL\MySQLi\PDO
            database prefix: 'jos_'                # DB Prefix for tables
            install sample data: 'no'              # Do you want to Download the Sample Data Along with Joomla Installation, then keep it Yes
            sample data: 'Default English (GB) Sample Data'    # Default Sample Data
            admin email: '[email protected]'      # email Id of the Admin
            language: 'English (United Kingdom)'   # Language in which you want the Application to be Installed
        AcceptanceHelper:
            repo_folder: '/home/travis/build/joomla-extensions/weblinks/' # Path to the Extension repository. To be used by tests to install via Install from folder
            counter_test_url: 'http://localhost/weblinks/tests/joomla-cms3' # the url for the weblink item used to test hits counter
            url: 'http://localhost/weblinks/tests/joomla-cms3' # the url that points to the joomla installation at /tests/system/joomla-cms - we need it twice here
error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED"
env:
    desktop: ~
    tablet:
        modules:
            config:
                JoomlaBrowser:
                    window_size: 768x1024
    phone:
        modules:
            config:
                JoomlaBrowser:
                    window_size: 480x640

12. Optional: Go back to weblinks directory and create and edit the file RoboFile.ini. Delete the local user www-data.

/var/www/html/weblinks$ cp RoboFile.dist.ini RoboFile.ini
/var/www/html/weblinks$ cat RoboFile.ini
; If set to true, the repo will not be cloned from GitHub and the local copy will be reused.
; This setting will be obsolete once we have local Git cache enabled
skipClone = false

; If you want to setup your test website in a different folder, you can do that here.
; You can also set an absolute path, i.e. /path/to/my/cms/folder
cmsPath = tests/joomla-cms3

; If you want to clone a different branch, you can set it here
branch = 3.10-dev

; (Linux / Mac only) If you want to set a different owner for the CMS root folder, you can set it here.
localUser =

; Set this to true, if your curl binaries are not able to create an https connection
insecure = false

13. Optional: Set use owner of the project to your user.

/var/www/html/weblinks$sudo chown -R username:usergroup /var/www

14. Ready! Run the first tests:

/var/www/html/weblinks$ vendor/bin/robo run:tests
Clone nach 'tests/cache' ...
 [Exec] Done in 13.18s
 [FileSystem\CopyDir] Copied from tests/cache to tests/joomla-cms3
...

Tests

The tests in Weblinks Extension use Codeception Testing Framework, if you want to know more about the technology used for testing please check: Testing Joomla Extensions with Codeception.

Optional: extra configuration for RoboFile

This is not required, and if in doubt you can just skip this section, but there may be some specific use cases when you need (or want) to override the default behaviour of RoboFile.php. To do this, copy RoboFile.dist.ini to RoboFile.ini and add options in INI format, one per line, e.g.

skipClone = true
cmsPath = tests/joomla

The currently available options are as follows:

  • skipClone: set to true to avoid the cms repo being deleted and re-cloned at each test execution. Useful to save time and bandwidth while you're debugging your test environment. But please be aware that if you don't refresh the repo you'll have to manually check the installation folder is present and the configuration.php is not.
  • cmsPath: set to the local path (absolute or relative) where you'd like the test website to be installed. Default is tests/joomla-cms3.
  • branch: set to whatever existing branch from the joomla-cms project if you want to clone that specific branch. Default is 3.10-dev.

Additional options

You can run the tests against different resolutions. The default acceptance YAML configuration file provides three options:

  • "desktop": default, 1024x768px
  • "tablet": tablet in portrait mode, 768x1024px
  • "phone": phone in portrait mode, 480x640px

To set a specific resolution, set is as an option of the command:

$ vendor/bin/robo run:tests --env=tablet

Note: the first parameter is used by Travis and you should always set it to "0" when you run your tests locally.

Video

Here you can finde a video that shows the installation of com_weblinks for testing.

For Windows:

You need to install:

Note: For commands line is better if you use the 'Git shell' program.

First you should create a fork of the official repository and clone the fork into your web server folder.

To prepare the system tests (Selenium) to be run in your local machine you are asked to rename the file tests/acceptance.suite.dist.yml to tests/acceptance.suite.yml. Afterwards, please edit the file according to your system needs.

The next step is only required if you don't place the weblinks folder into your web server folder. Create a symbolic link from your tests\joomla-cms3 to a subfolder of your web server. For example:

mklink /J C:\wamp\www\tests\joomla-cms3 C:\Users\Name\Documents\GitHub\weblinks\tests\joomla-cms3

Open the console and go in the folder of weblinks, for example:

cd C:\wamp\www\weblinks

Then run the command:

$ composer install

You can then run the following command to start the tests:

$ vendor/bin/robo run:tests

Once all tests were executed, you may also run a specific test:

$ vendor/bin/robo run:test // Then select the test you want to run!

weblinks's People

Contributors

810 avatar alikon avatar andrepereiradasilva avatar astridx avatar beat avatar brianteeman avatar chrisdavenport avatar compojoom avatar dgrammatiko avatar eddieajau avatar hackwar avatar infograf768 avatar jatitoam avatar javigomez avatar joomdonation avatar joomla-dependency-bot avatar kshitijsharma2014 avatar kubik-rubik avatar mbabker avatar photodude avatar pritalpatel avatar puneet0191 avatar rdeutz avatar richard67 avatar roland-d avatar therunnergit avatar wderuijter avatar wilsonge avatar yvesh avatar zero-24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weblinks's Issues

Feature Request: Front End User Submission

Back in the Joomla 1.5 days, I used TEG's Bookmarks component, which had a feature that allowed users to submit new links, which an Admin would then approve (and edit / update / modify, as needed). I would very much like to see a Submit feature make its way into Weblinks, please.

teste

Steps to reproduce the issue

1- Pa
2-Pum
3-Cá

Expected result

Actual result

System information (as much as possible)

Additional comments

Support and retirement strategy

What support "contract" should decoupled extensions have with their users? Same as CMS?

When or how do we decide it's no longer viable to support this extension?

Robo create:testing-site Fails on Ubuntu

after the recent changes to create:testing-site function in RoboFile.php, I am not able to use this function, but previously I was able to use this function on my machine without any issues, but now it seems to throw an error. I am attaching a screenshot of the error with this.

image

Two "images" tabs in Web links

Hi,
As an user said today in french Joomla! forum, on Joomla! 3.4.4, web links have two "images" tabs, so adding an image is not possible. I tested and confirm. You can save, but images are not saved: if you edit, all fields remains empty.
weblinks
Thanks for your help!
Robert

What to we call "decoupled" extensions?

We need a colloquial term for these extensions that we are decoupling from the #Joomla CMS core. Suggestions?

Note that this can also include extensions like com_testpatcher, a number of modules from GSOC projects, etc and so on.

  • Off Core

Documentation

How do we move the help screens from docs.joomla.org to this repository?

System tests for com_weblinks

  • Administrator: create a category (Javier)
  • Administrator: can't create a category (Javier)
  • Administrator: delete a category (@puneet0191)
  • Administrator: Create a weblink (Beat)
  • Administrator: Delete a weblink (Beat)
  • Administrator: Modify a weblink (Beat)
  • Administrator: Publish a weblink (@yvesh)
  • Administrator: Unpublish a weblink (@yvesh)
  • Frontend: create a menu to a weblink (@compojoom)
  • Frontend: create a menu to a category of weblinks (@yvesh)
  • Create a weblink in backend and confirm it exits and is visible in frontend (@yvesh)
  • Create a menu item: Displays a list of Web Links for a category
  • Submit a Web Link

weblinks update having issues

Hi... ive unzipped package update and individually installed all mods & coms successfully however, keeps reverting back that i have updates for weblinks.... happening to ALL my joomla sites.... please help.... thanks Steve :)

Version strategy

How is the version strategy going to work?

Suggestion: Keep the major version the same as the Joomla CMS and start from 3.0.0.

Patches increment the last number, for example 3.0.1, 3.0.2.

New features increment the middle number, for example, 3.1.0, 3.2.0.

Language files

The language files here are out of sync with the ones in the main joomla-cms repo

How to do system test

Any extension will need Joomla to be system tested, but if they are provided as a standalone package, how can we test them? The solution we found is to add joomla-cms as a GIT submodule. The first tests we run is the Joomla installer so we install Joomla. Then we install the extension, for example com_weblinks, using the install from folder installer. Finally we are ready to run the extension tests.

Me and @puneet0191 have already a working example. We will pull it here as soon as possible.

Installing pkg_weblinks_3.4.1-rc.zip on a legacy site

I tried installing the package on a legacy site updated to 3.4.2-dev (i.e. weblinks still present).
I get these errors:


Warning

Duplicate column name 'version' SQL=ALTER TABLE `jos_weblinks` ADD COLUMN `version` int(10) unsigned NOT NULL DEFAULT '1';

Package Update: There was an error installing an extension: com_weblinks.zip
Error

Error installing package

Uninstall xml remains

Install weblinks on a clean Joomla 3.4.3
Uninstall weblinks
/administrator/manifests/packages/pkg_weblinks.xml is left on the server

core_urls: url or core_urls: urls

The fix provided by Elin W has been applied several times now in Joomla core. Unfortunately it gets overrulled without properly documenting whether that is intentionally.

Currently it is set to urls, which looks like the wrong value, it should be url.
If that is not a true statement it would help if somebody explains what the correct value should be!

Group by subcategories on mod_weblinks

Mod_weblinks is lacking an interesting feature: when selecting a "master" category, links cannot be grouped by subcategory. Such enhancement would allow additional layout compatibility.

configuration comment in acceptance.suite.dist.yml

url: 'http://localhost/tests/joomla-cms3' # the url that points to the joomla installation at /tests/system/joomla-cms

....is confusing, since there isn't such a path at this moment, at least before the first run (I guess)

[edit] Or is this related to the 'cms-path'-value in the robo file?

Create a release automated solution based in Robo

We need a script based in robo.li (see https://github.com/joomla-extensions/weblinks/blob/master/RoboFile.php) that automates the release of this extension. The scripts should allow to:

Add tests for different resolutions

We assume the component should work fine at all the following resolutions:

  • 1024x768px (desktop)
  • 768x1024 (tablet)
  • 480x320 (smartphone)

I will start by manually change the resolution in configuration and run the full test suite,

Hit, Clicks and Errors Oh My

Hello -

What is the difference between hits and clicks? If I turn on Hits I see a hits marker. However, it never gets incremented. If I turn on clicks, it gives me an error and says website not found.

Can't install joomla on windows

The system test fails to install joomla on my Windows machine. The test fails to find the next button on the page with the language select.

I see that in the test we have this

 // Select a random language to force reloading of the lang strings after selecting English
$I->selectOptionInChosen('#jform_language', 'Danish (DK)');
$I->selectOptionInChosen('#jform_language', 'English (United Kingdom)');

In my case I end up with danish, instead of english. Tried with waiting 2 sec between the selection, but this didn't help either. The only way to go around this is to just select english.

I'm also not sure that I understand the logic of the comment? Force reloading of the lang strings? The default language is english? Why do we need to reload it?

Installation issue with MariaDB

I've had Joomla 3.3.6 with com_weblinks. Soon Joomla was updated to 3.4.1 and com_weblinks is needed to be updated. I took latest version of weblinks component from here, tried to install and got this error message:

Warning
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'delimiter ';;' create procedure weblinks_schema_change() begin /* delete colum' at line 1 SQL=delimiter ';;' create procedure weblinks_schema_change() begin /* delete columns if they exist */ if exists(SELECT * FROM information_schema.columns WHERE table_name = '#__weblinks' AND column_name = 'sid') THEN ALTER TABLE thm7_weblinks DROP COLUMN sid;

Joomla 3.4.1
DB: 5.5.37-MariaDB-wsrep

3.4.1-rc SQL error

Duplicate column name 'version' SQL=ALTER TABLEp52jk_weblinksADD COLUMNversionint(10) unsigned NOT NULL DEFAULT '1';

Update Joomla 3.3.6 to 3.4.1 upload and install the RC package.

I guess we need something like for the drop colums also for the add colums?

Weblinks selected image doesn't save

Steps to reproduce the issue

Install the Weblinks package into Joomla
Create a new weblink
In the images select an image
Save
Message says saved but image field shows empty

Expected result

Image field should show the image link that was selected

Actual result

Message says saved but image field shows empty

System information (as much as possible)

Windows 10 but sys info says 8

PHP Built On Windows NT MY-COMPUTER 6.2 build 9200 (Windows 8 Home Premium Edition) i586
Database Version 5.6.26
Database Collation utf8_general_ci
PHP Version 5.5.28
Web Server Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.5.28
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.4.5 Development [ Ember ] 8-September-2015 21:30 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0

Additional comments

Trouble updating Joomla weblinks extension in Joomla 3.4.3

Site is Joomla 3.4.3 - updated from Joomla 2.x

Tried to install the weblinks extension (through the extension manager) over the currently installed extension resulting in the following messages: (other extension updates have been successful)


Warning
Error connecting to the server: SSL certificate problem: unable to get local issuer certificate


Error
Package download failed: https://github.com/joomla-extensions/weblinks/releases/download/3.4.1/pkg_weblinks_3.4.1.zip


If I were to uninstall the extensions first and upload the zip file to install, I'm not sure which to uninstall since there are several.

weblinks-extensions

Bug Handling

Decentralising an extension presents a problem with decentralised bug and issue handling. What does that look like in a decoupled world and what changes do we need to make to information we have out there about the bug handling process?

Can't upgrade... SQL Error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delimiter ';;' create procedure weblinks_schema_change() begin /* delete colum' at line 1 SQL=delimiter ';;' create procedure weblinks_schema_change() begin /* delete columns if they exist */ if exists(SELECT * FROM information_schema.columns WHERE table_name = '#__weblinks' AND column_name = 'sid') THEN ALTER TABLE mmp_exd_j25_weblinks DROP COLUMN sid;

Package Install: There was an error installing an extension: com_weblinks.zip

SSL error on update

When I try to update Weblinks to version 3.4.1, I got the following errors:
Error connecting to the server: SSL certificate problem: unable to get local issuer certificate

Package download failed: https://github.com/joomla-extensions/weblinks/releases/download/3.4.1/pkg_weblinks_3.4.1.zip

Allow using PHP 7 in travis build

@jatitoam I'm leaving this one for you for when you have time. No rushes.

#113

The task would be to make it work the PHP7

But we are probably moving to Docker before that so, maybe we don't need to lose time on it.

Edit button visible when there are no categories

When there are no categories the New button is not shown because there are no categories. However the other buttons are shown even when there are no entries. These buttons are useless as well since there are no entries nor new entries can be created.

Refactor

Whilst I understand /src is the "PHP" way of doing things - I don't think that's the best way for Joomla extensions. I find that laying them out as you find them in the CMS is much easier for debugging.

For example: https://github.com/JoomJunk/Accordion

There I have my modules in the correct folders then the entire CMS in .gitignore. This means I can install my module into the CMS and make any changes I want and see them reflected life time. Then it's easy to push them back into the repo without having to copy the changes you were trialing in the CMS.

I hope this makes sense :)

Fields are cleared on the frontend in case of error

I did a clean installl of Joomla 3.3.6 accepting all defaults and I only added a menu item to "Submit a Web Link", no other changes.
When adding a duplicated weblink from the frontend I get the expected error message but all form fields are empty, while doing the same from the backend all field contents are preserved and I still get error message, as expected.

SQL error when versioning enabled

Update J!2.5.28 to 3.4.1 (with known problems).

After applying patch from
#30
(Thanks for it!)

and actvating Versioning in Weblinks > Options we have an SQL error while saving a weblink.

"
Error

Save failed with the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND sha1_hash = '093f558adc1ca35ced94ba8xyz'' LIMIT 0, 1' at line 3 SQL=SELECT * FROM xxxx_ucm_history WHERE ucm_item_id = 9 AND ucm_type_id = AND sha1_hash = '093f558adc1ca35ced94ba8xyz' LIMIT 0, 1
"

Error is here (no ucm_type_id)

AND `ucm_type_id` = AND `sha1_hash`

/libraries/cms/table/contenthistory.php

We need a generic way to create testing objects

Different ways of naming objects are used in weblinks test. We should find a common way to put titles in generated elements: categories, weblinks...

The AdministratorCategoryCest file needs to be refactored to use @Depends tag and to define in the constructor the category object that we will use.

Unnecessary closing div tag

Steps to reproduce the issue

Display weblinks component. Unnecessary tag in /components/com_weblinks/views/categories/tmpl/default.php causes mess in template. Line number 17.

Expected result

Correct display of weblinks component. Solution is create weblinks override without closing div tag.

Actual result

Mess in weblinks in custom template.

System information (as much as possible)

Linux, Apache, Mysql

Screenshots from messed webpage and corrected one:
http://image.qkiz.pl/di/UBY5/bad.png
http://image.qkiz.pl/di/TNQP/good.png

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.