Skip to content

Fix replacing every src string / Issue from Weblinks repo #376

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -783,17 +783,18 @@ private function parseFileList(array $files): array
$filePath = explode('/', $prodFileName);
// Remove the `src` here to match the CMS paths if needed
if ($filePath[0] === 'src') {
$prodFileName = str_replace('src/', '', $prodFileName);
$prodFileName = preg_replace('/^src\\//', '', $prodFileName, 1);
}

if ($prodRenamedFileName) {
$filePath = explode('/', $prodRenamedFileName);
// Remove the `src` here to match the CMS paths if needed
if ($filePath[0] === 'src') {
$prodRenamedFileName = str_replace(
'src/',
$prodRenamedFileName = preg_replace(
'/^src\\//',
'',
$prodRenamedFileName
$prodRenamedFileName,
1
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,27 @@
endif; ?>
</td>
<td class="text-center">
<?php $hideButton = function($labels) {
foreach ($labels as $label) {
if (in_array(strtolower($label->name), ['npm resource changed', 'composer dependency changed', 'rtc'])) {
return true;
}
}
<?php $hideButton = function ($labels) {
foreach ($labels as $label) {
if (in_array(strtolower($label->name), ['npm resource changed', 'composer dependency changed', 'rtc'])) {
return true;
}
}

return false;
};?>
<?php if ($this->settings->get('advanced', 0) || !$hideButton($item->labels)) : ?>
<?php if ($item->applied) :
?>
<?php if ($item->applied) :
?>
<button type="button" class="btn btn-sm btn-success submitPatch"
data-task="revert" data-id="<?php echo (int) $item->applied; ?>"><?php echo Text::_('COM_PATCHTESTER_REVERT_PATCH'); ?></button>
<?php
else :
?>
<?php
else :
?>
<button type="button" class="btn btn-sm btn-primary submitPatch"
data-task="apply" data-id="<?php echo (int) $item->pull_id; ?>"><?php echo Text::_('COM_PATCHTESTER_APPLY_PATCH'); ?></button>
<?php
endif; ?>
<?php
endif; ?>
<?php endif; ?>
</td>
</tr>
Expand Down