Skip to content

Commit fd44180

Browse files
Merge branch '5.x-dev' into phpstan_fix
2 parents 2b11e27 + c536294 commit fd44180

File tree

29 files changed

+703
-92
lines changed

29 files changed

+703
-92
lines changed

.php-cs-fixer.dist.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@
7272
'native_function_invocation' => ['include' => ['@compiler_optimized']],
7373
// Adds null to type declarations when parameter have a default null value
7474
'nullable_type_declaration_for_default_null_value' => true,
75+
// Removes unneeded parentheses around control statements
76+
'no_unneeded_control_parentheses' => true,
77+
// Using isset($var) && multiple times should be done in one call.
78+
'combine_consecutive_issets' => true,
79+
// Calling unset on multiple items should be done in one call
80+
'combine_consecutive_unsets' => true,
81+
// There must be no sprintf calls with only the first argument
82+
'no_useless_sprintf' => true,
7583
]
7684
)
7785
->setFinder($finder);

CODE_OF_CONDUCT.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Joomla Contributor Covenant Code of Conduct
2+
3+
This document outlines the Code of Conduct for all persons volunteering their service to the Joomla Project and/or Open Source Matters. It covers your behaviour as a member of the Joomla community, in any forum, mailing list, Wiki, website, IRC channel, install-fest, public meeting or private correspondence.
4+
5+
If you cannot agree to any of these principles, then volunteering in the Joomla Project is not for you. Contributing to our community assumes acceptance of these principles:
6+
## Be Considerate
7+
8+
You are working with others as a team so be considerate of how your actions or contribution affects your colleagues and the community as a whole.
9+
## Be Respectful
10+
11+
Treat one another and members of the community with respect. Everyone can make a valuable contribution to Joomla. We may not always agree, but disagreement is no excuse for poor behavior or poor manners.
12+
13+
We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It's important to remember that a community where people feel uncomfortable or threatened is not a productive one. We expect the members of Joomla community to be respectful when dealing with other volunteers as well as with people from outside projects and initiatives and with users.
14+
15+
Avoid becoming involved in flame wars, trolling, personal attacks, and repetitive arguments. Take the matters "outside" (off-list, etc) if it helps resolve the situation, and do not use communal methods of communication to be a vehicle for your private "wall of shame."
16+
## Be Collaborative
17+
18+
Joomla is free software and about collaboration and working together. Collaboration reduces redundancy of work done in the free software world, and improves the quality of the software produced regardless of whether you are writing code or performing some other task.
19+
20+
When you disagree, consult others. Disagreements, both political and technical, happen all the time, and Joomla is no exception. Disagreement, debate and constructive criticism is often how progress is made and are a necessary part of doing complex work in a team.
21+
22+
The important goal is not to avoid disagreements or differing views but to resolve them constructively. Above all, avoid making conflicts about the work into personal conflicts. Debate should never include reference to someone's nationality, gender, religion or other personal characteristics.
23+
24+
You should turn to the community and to the community process to seek advice and to resolve disagreements. Team leaders and Department Coordinators are able to help you figure out which direction will be most acceptable.
25+
26+
When you are unsure, ask for help. Nobody knows everything and nobody is expected to be perfect. Asking questions avoids many problems down the road and so questions are encouraged. Those who are asked should be responsive and helpful. However, when asking a question, care must be taken to do so in an appropriate forum. Off-topic questions, such as requests for help on a development mailing list, detract from productive discussion.
27+
## Step Down Considerately
28+
29+
People on every project come and go, and Joomla is no different. When you leave or disengage from the community, in whole or in part, we ask that you do so in a way that minimizes disruption to the Project. This means you should tell people you are leaving and take the proper steps to ensure that others can pick up where you leave off.
30+
## Be Available
31+
32+
Check your e-mails regularly and answer them promptly—even if it's "I'll get back to you."
33+
## Be Honest
34+
35+
Sometimes the hardest thing to say is "no" or admit you've forgotten to do something. Be honest with each other and yourself with regards to what you say and what you can realistically commit to.
36+
## Follow the Rules
37+
38+
Volunteers are expected to uphold Joomla's licensing and trademark requirements including, but not limited to, compliance on their own or affiliate websites and extensions. Make sure you have sought the appropriate approvals for domain name, name and logo usage prior to volunteering and that any extensions you distribute comply with the Joomla license.
39+
40+
All work contributed to the Project, whether code, documentation or other material, must observe the appropriate licenses as set down by the Core Team and Open Source Matters.
41+
42+
Some contributors represent the Joomla Project in specific areas, but you should not speak on behalf of the Project or present yourself as an official representative of the Project unless you are specifically authorized to do so, and you should never state your opinions as the official policies of the Project.
43+
## Exercise Discretion and Confidentiality at Appropriate Times
44+
45+
Depending on your role, you will be privy to various levels of information. As a volunteer you are expected to keep site access details (such as logins, FTP details, etc.) secure at all times.
46+
47+
Information contained within private forums (for example, about serious security matters, legal cases, or personal details), private mailing lists, chats or other mediums is also to be kept confidential even after you have discontinued your service. Breaches in the area of privacy and confidentiality are taken very seriously by the Project.
48+
## Conflict of Interest
49+
50+
When using Project resources or making decisions within the board, your department, team, or subteam or the concerning Project's policy positions, you must do so based only on the best interests of the Project and its user community. If you have a situation or affiliation that might constitute or lead to a conflict of interest or might be perceived by a reasonable person in the community to be a conflict of interest, disclose this to your Team Leaders or the team as a whole. If appropriate, after discussing with your team, you should remove yourself from specific decisions or discussions in which you may have a conflict of interest.
51+
## Conflict Resolution Team
52+
53+
Should you wish to make a CoC violation report or are facing a conflict that has failed to be resolved in the manner set out in this CoC, please [click here](https://docs.google.com/forms/d/e/1FAIpQLSea_VL9NUvUM3iX-gptNuJe5oz5-jp9y5Y4v9ZyKImblfYTcQ/viewform) to access the report form.
54+
## The Fine Print
55+
56+
Members of the board of Open Source Matters are governed by additional guidelines and requirements and, where a conflict exists, these take precedence over this Code of Conduct.
57+
## The Last Bit
58+
59+
This Code of Conduct has changed over time and will continue to develop, but was originally derived, with permission, from the Ubuntu CoC.
60+
61+
Last Updated 8th of June 2017
62+
Online version of this document is available at https://www.joomla.org/about-joomla/the-project/code-of-conduct.html

cypress.config.dist.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default defineConfig({
77
screenshotsFolder: 'tests/cypress/output/screenshots',
88
viewportHeight: 1000,
99
viewportWidth: 1200,
10-
e2e: {
10+
e2e: {
1111
setupNodeEvents(on, config) {
1212
setupPlugins(on, config);
1313
},
@@ -16,6 +16,7 @@ export default defineConfig({
1616
'tests/cypress/integration/install/*.cy.{js,jsx,ts,tsx}',
1717
'tests/cypress/integration/administrator/**/*.cy.{js,jsx,ts,tsx}',
1818
'tests/cypress/integration/site/**/*.cy.{js,jsx,ts,tsx}',
19+
'tests/cypress/integration/api/**/*.cy.{js,jsx,ts,tsx}',
1920
'tests/cypress/integration/plugins/**/*.cy.{js,jsx,ts,tsx}',
2021
],
2122
supportFile: 'tests/cypress/support/index.js',

jorobo.dist.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extension = weblinks
2-
version = 4.0.0
2+
version = 5.0.0-dev
33
source = src
44
target = package
55

@@ -8,7 +8,7 @@ target = package
88
; and add Release to the target (separated by space) above
99
[github]
1010
remote = origin
11-
branch = develop
11+
branch = 5.x-dev
1212
token =
1313
owner = joomla-extensions
1414
repository = weblinks

src/administrator/components/com_weblinks/forms/weblink.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@
5858

5959
<field
6060
name="hits"
61-
type="text"
61+
type="hits"
6262
label="JGLOBAL_HITS"
63-
class="readonly"
64-
readonly="true"
65-
filter="unset"
63+
addfieldprefix="Joomla\Component\Weblinks\Administrator\Field"
6664
default="0"
6765
/>
6866

@@ -234,6 +232,16 @@
234232
name="jbasic"
235233
label="COM_WEBLINKS_FIELDSET_OPTIONS"
236234
>
235+
<field
236+
name="follow"
237+
type="list"
238+
label="COM_WEBLINKS_FIELD_FOLLOW_LABEL"
239+
default="nofollow"
240+
>
241+
<option value="follow">COM_WEBLINKS_FIELD_VALUE_FOLLOW</option>
242+
<option value="nofollow">COM_WEBLINKS_FIELD_VALUE_NOFOLLOW</option>
243+
</field>
244+
237245
<field
238246
name="target"
239247
type="list"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DELETE FROM `#__content_types` WHERE `type_alias` IN ('com_weblinks.weblink', 'com_weblinks.category');
2-
DELETE FROM `#__action_logs_extension` WHERE `extension` = 'com_weblinks';
3-
DELETE FROM `#__action_log_config` WHERE `type_title` = 'weblinks';
2+
DELETE FROM `#__action_logs_extensions` WHERE `extension` = 'com_weblinks';
3+
DELETE FROM `#__action_log_config` WHERE `type_title` = 'weblinks';
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DELETE FROM "#__content_types" WHERE "type_alias" IN ('com_weblinks.weblink', 'com_weblinks.category');
2-
DELETE FROM "#__action_logs_extension" WHERE "extension" = 'com_weblinks';
3-
DELETE FROM "#__action_log_config" WHERE "type_title" = 'weblinks';
2+
DELETE FROM "#__action_logs_extensions" WHERE "extension" = 'com_weblinks';
3+
DELETE FROM "#__action_log_config" WHERE "type_title" = 'weblinks';

src/administrator/components/com_weblinks/src/Extension/WeblinksComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function getContexts(): array
130130
*/
131131
protected function getTableNameForSection(?string $section = null)
132132
{
133-
return ($section === 'category' ? 'categories' : 'weblinks');
133+
return $section === 'category' ? 'categories' : 'weblinks';
134134
}
135135

136136
/**
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
/**
4+
* @package Joomla.Administrator
5+
* @subpackage com_weblinks
6+
*
7+
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
8+
* @license GNU General Public License version 2 or later; see LICENSE.txt
9+
*/
10+
11+
namespace Joomla\Component\Weblinks\Administrator\Field;
12+
13+
use Joomla\CMS\Form\FormField;
14+
use Joomla\CMS\Language\Text;
15+
16+
// phpcs:disable PSR1.Files.SideEffects
17+
\defined('_JEXEC') or die;
18+
// phpcs:enable PSR1.Files.SideEffects
19+
20+
/**
21+
* Hits field for Weblinks.
22+
* Renders a read-only input for hits and a reset button.
23+
*
24+
* @since __DEPLOY_VERSION__
25+
*/
26+
class HitsField extends FormField
27+
{
28+
/**
29+
* The form field type.
30+
*
31+
* @var string
32+
* @since __DEPLOY_VERSION__
33+
*/
34+
protected $type = 'Hits';
35+
36+
/**
37+
* Method to get the field input markup.
38+
*
39+
* @return string The field input markup.
40+
*
41+
* @since __DEPLOY_VERSION__
42+
*/
43+
protected function getInput()
44+
{
45+
$onclick = ' onclick="document.getElementById(\'' . $this->id . '\').value=\'0\';"';
46+
47+
return '<div class="input-group"><input class="form-control" type="text" name="' . $this->name . '" id="' . $this->id . '" value="'
48+
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" readonly="readonly">'
49+
. '<button type="button" class="btn btn-secondary" ' . $onclick . '>'
50+
. '<span class="icon-sync" aria-hidden="true"></span> ' . Text::_('JRESET') . '</button></div>';
51+
}
52+
}

src/administrator/components/com_weblinks/src/View/Weblinks/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protected function addToolbar()
168168
$user = $this->getCurrentUser();
169169

170170
// Get the toolbar object instance
171-
$toolbar = $this->getDocument()->getToolbar();
171+
$toolbar = $this->getDocument()->getToolbar();
172172

173173
ToolbarHelper::title(Text::_('COM_WEBLINKS_MANAGER_WEBLINKS'), 'link weblinks');
174174

0 commit comments

Comments
 (0)